提交价格列表中心

master
CJYXTX\27961 8 months ago
parent d214443598
commit 4ba2d2ee8a

@ -74,7 +74,7 @@ spring:
host: 127.0.0.1
port: 6379
# password: qweasd,.123 # 密码为空时,请将本行注释
password: 123456 # 密码为空时,请将本行注释
# password: 123456 # 密码为空时,请将本行注释
timeout: 3000 #超时时间(单位:秒)
lettuce: #Lettuce为Redis的Java驱动包
pool:

@ -2,6 +2,76 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.NxPriceMapper">
<resultMap id="getNxPriceMap" type="jnpf.entity.NxPriceEntity">
<id column="id" property="id"/>
<result column="price_code" property="priceCode"/>
<result column="buiness_id" property="buinessId"/>
<result column="price_type" property="priceType"/>
<result column="remak" property="remak"/>
<result column="f_creator_time" property="creatorTime"/>
<result column="f_creator_user_id" property="creatorUserId"/>
<result column="f_last_modify_time" property="lastModifyTime"/>
<result column="f_last_modify_user_id" property="lastModifyUserId"/>
<result column="creatorUserIds" property="creatorUserIds"/>
<result column="lastModifyUserIds" property="lastModifyUserIds"/>
<result column="recoveryPrice" property="recoveryPrice"/>
<result column="productCode" property="productCode"/>
<result column="productName" property="productName"/>
<result column="stationName" property="stationName"/>
<result column="stationCode" property="stationCode"/>
<result column="priceStatus" property="priceStatus"/>
</resultMap>
<select id="queryByKeyword" resultMap="getNxPriceMap">
SELECT
a.*,
b.recovery_price AS recoveryPrice,
c.code AS productCode,
c.name AS productName,
CASE
c.unit
WHEN 1 THEN
'克'
WHEN 2 THEN
'千克'
WHEN 3 THEN
'吨'
END unit,
e.station_name AS stationName,
e.station_code AS stationCode,
CASE
a.status
WHEN 1 THEN
'生效'
WHEN 2 THEN
'失效'
END priceStatus,
f.f_real_name AS creatorUserIds,
g.f_real_name AS lastModifyUserIds
FROM
nx_price a
LEFT JOIN nx_price_product b ON a.id = b.price_id
LEFT JOIN nx_product c ON b.product_id = c.id
LEFT JOIN nx_price_recycle d ON a.id = d.price_id
LEFT JOIN nx_enterprise_recycle_station e ON d.recycle_id = e.id
LEFT JOIN base_user f ON f.f_id=a.f_creator_user_id
LEFT JOIN base_user g ON g.f_id=a.f_last_modify_user_id
${ew.customSqlSegment} and a.f_delete_mark is null
<!-- <if test="nxProductPagination.productName != null and nxProductPagination.productName != ''">-->
<!-- AND c.name = #{nxProductPagination.productName}-->
<!-- </if>-->
<!-- <if test="nxProductPagination.stationName != null and nxProductPagination.stationName != ''">-->
<!-- AND e.station_name = #{nxProductPagination.stationName}-->
<!-- </if>-->
<if test="nxProductPagination.sidx != null and nxProductPagination.sidx != ''">
ORDER BY ${nxProductPagination.sidx} ${nxProductPagination.sort}
</if>
</select>
</mapper>

@ -1,8 +1,14 @@
package jnpf.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jnpf.entity.NxPriceEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.model.nxprice.NxPricePagination;
import jnpf.model.nxproduct.NxProductPagination;
import org.apache.ibatis.annotations.Param;
/**
* nxPrice
@ -13,4 +19,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface NxPriceMapper extends BaseMapper<NxPriceEntity> {
IPage<NxPriceEntity> queryByKeyword(@Param("page") Page<NxPriceEntity> page, @Param("nxProductPagination") NxPricePagination nxPricePagination, @Param("ew") QueryWrapper<NxPriceEntity> NxPriceEntityQueryWrapper);
}

@ -50,6 +50,8 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
private NxPriceProductService nxPriceProductService;
@Autowired
private NxPriceRecycleService nxPriceRecycleService;
@Autowired
private NxPriceMapper nxPriceMapper;
@Override
public List<NxPriceEntity> getList(NxPricePagination nxPricePagination){
return getTypeList(nxPricePagination,nxPricePagination.getDataType());
@ -232,7 +234,31 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
String value = nxPricePagination.getPriceCode() instanceof List ?
JsonUtil.getObjectToString(nxPricePagination.getPriceCode()) :
String.valueOf(nxPricePagination.getPriceCode());
nxPriceQueryWrapper.lambda().like(NxPriceEntity::getPriceCode,value);
// nxPriceQueryWrapper.lambda().like(NxPriceEntity::getPriceCode,value);
nxPriceQueryWrapper.like("a.PRICE_CODE",value);
}
if(ObjectUtil.isNotEmpty(nxPricePagination.getProductName())){
nxPriceNum++;
String value = nxPricePagination.getProductName() instanceof List ?
JsonUtil.getObjectToString(nxPricePagination.getProductName()) :
String.valueOf(nxPricePagination.getProductName());
nxPriceQueryWrapper.like("c.NAME",value);
}
if(ObjectUtil.isNotEmpty(nxPricePagination.getStationName())){
nxPriceNum++;
String value = nxPricePagination.getStationName() instanceof List ?
JsonUtil.getObjectToString(nxPricePagination.getStationName()) :
String.valueOf(nxPricePagination.getStationName());
nxPriceQueryWrapper.like("e.STATION_NAME",value);
}
@ -297,7 +323,7 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
if(ObjectUtil.isNotEmpty(nxPricePagination.getCreatorUserId())){
nxPriceNum++;
nxPriceQueryWrapper.lambda().eq(NxPriceEntity::getCreatorUserId,nxPricePagination.getCreatorUserId());
nxPriceQueryWrapper.eq("a.F_CREATOR_USER_ID",nxPricePagination.getCreatorUserId());
}
@ -308,9 +334,10 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
Long fir = Long.valueOf(String.valueOf(CreatorTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(CreatorTimeList.get(1)));
nxPriceQueryWrapper.lambda().ge(NxPriceEntity::getCreatorTime, new Date(fir))
.le(NxPriceEntity::getCreatorTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
// nxPriceQueryWrapper.lambda().ge(NxPriceEntity::getCreatorTime, new Date(fir))
nxPriceQueryWrapper.ge("a.F_CREATOR_TIME", new Date(fir))
.le("a.F_CREATOR_TIME", DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59"));
}
@ -338,7 +365,7 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
nxPriceQueryWrapper.lambda().in(NxPriceEntity::getId, intersection);
nxPriceQueryWrapper.in("a.id", intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
@ -346,7 +373,7 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
nxPriceQueryWrapper.lambda().and(t->t.in(NxPriceEntity::getId, finalAllSuperIDlist));
nxPriceQueryWrapper.and(t->t.in("a.id", finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
@ -354,14 +381,16 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
nxPriceQueryWrapper.lambda().and(t->t.in(NxPriceEntity::getId, finalAllRuleIDlist));
nxPriceQueryWrapper.and(t->t.in("a.id", finalAllRuleIDlist));
}
//假删除标志
nxPriceQueryWrapper.lambda().isNull(NxPriceEntity::getDeleteMark);
// nxPriceQueryWrapper.lambda().isNull(NxPriceEntity::getDeleteMark);
nxPriceQueryWrapper.isNull("a.f_delete_mark");
//排序
if(StringUtil.isEmpty(nxPricePagination.getSidx())){
nxPriceQueryWrapper.lambda().orderByDesc(NxPriceEntity::getId);
// nxPriceQueryWrapper.lambda().orderByDesc(NxPriceEntity::getId);
nxPricePagination.setSidx("a.f_creator_time");
nxPricePagination.setSort("DESC");
}else{
try {
String sidx = nxPricePagination.getSidx();
@ -370,7 +399,9 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
Field declaredField = nxPriceEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
nxPriceQueryWrapper="asc".equals(nxPricePagination.getSort().toLowerCase())?nxPriceQueryWrapper.orderByAsc(value):nxPriceQueryWrapper.orderByDesc(value);
nxPricePagination.setSidx("a." + value);
// nxPriceQueryWrapper="asc".equals(nxPricePagination.getSort().toLowerCase())?nxPriceQueryWrapper.orderByAsc(value):nxPriceQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
@ -379,7 +410,9 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<NxPriceEntity> page=new Page<>(nxPricePagination.getCurrentPage(), nxPricePagination.getPageSize());
IPage<NxPriceEntity> userIPage=this.page(page, nxPriceQueryWrapper);
// IPage<NxPriceEntity> userIPage=this.page(page, nxPriceQueryWrapper);
IPage<NxPriceEntity> userIPage = nxPriceMapper.queryByKeyword(page, nxPricePagination, nxPriceQueryWrapper);
return nxPricePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<NxPriceEntity> list = new ArrayList();

@ -103,7 +103,7 @@ public class NxPriceController {
realList.add(nxPriceMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, NxPriceConstant.getFormData(), NxPriceConstant.getColumnData(), nxPricePagination.getModuleId(),false);
// realList = generaterSwapUtil.swapDataList(realList, NxPriceConstant.getFormData(), NxPriceConstant.getColumnData(), nxPricePagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
@ -335,6 +335,36 @@ public class NxPriceController {
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
*
* @param id
* @return
*/
@PostMapping("/closestatus/{id}")
@Operation(summary = "生效失效更新")
public ActionResult closestatus(@PathVariable("id") String id){
UserInfo userInfo=userProvider.get();
NxPriceEntity entity= nxPriceService.getInfo(id);
QueryWrapper<NxPriceEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(NxPriceEntity::getId,entity.getId());
// System.out.println(entity);
if(entity!=null && entity.getStatus()==2){
entity.setStatus(1);
nxPriceService.update(id, entity);
return ActionResult.success("更新成功");
} else if(entity!=null && entity.getStatus()==1){
entity.setStatus(2);
nxPriceService.update(id, entity);
return ActionResult.success("更新成功");
}else{
return ActionResult.fail("更新失败,数据不存在");
}
}
/**
*
* @param id

@ -44,4 +44,27 @@ public class NxPriceEntity {
private String flowId;
@TableField("F_VERSION")
private Integer version;
@TableField("STATUS")
private Integer status;
@TableField(exist = false)
private String recoveryPrice;
@TableField(exist = false)
private String productCode;
@TableField(exist = false)
private String productName;
@TableField(exist = false)
private String unit;
@TableField(exist = false)
private String stationName;
@TableField(exist = false)
private String stationCode;
@TableField(exist = false)
private String priceStatus;
@TableField(exist = false)
private String creatorUserIds;
@TableField(exist = false)
private String lastModifyUserIds;
}

@ -42,4 +42,13 @@ public class NxPricePagination extends Pagination {
/** 创建时间 */
@JsonProperty("creatorTime")
private Object creatorTime;
/** 商品名称 */
@JsonProperty("productName")
private Object productName;
/** 回收站 */
@JsonProperty("stationName")
private Object stationName;
}

@ -35,4 +35,8 @@ public class NxProductForm {
/** 备注 **/
@JsonProperty("remak")
private String remak;
/** 备注 **/
@JsonProperty("status")
private Integer status;
}

@ -1,10 +1,4 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
@ -20,31 +14,29 @@
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="报价方">
<JnpfOrganizeSelect
selectType="all"
v-model="query.buinessId"
placeholder="请选择
"
<el-form-item label="商品名称">
<el-input
v-model="query.productName"
placeholder="请输入"
clearable
multiple
/>
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="价格类型">
<JnpfSelect
v-model="query.priceType"
placeholder="请选择"
<el-form-item label="回收站">
<el-input
v-model="query.stationName"
placeholder="请输入"
clearable
:options="priceTypeOptions"
:props="priceTypeProps"
multiple
>
</JnpfSelect>
</el-input>
</el-form-item>
</el-col>
<template v-if="showAll">
<el-col :span="6">
<el-form-item label="创建用户">
@ -148,20 +140,66 @@
:span-method="arraySpanMethod"
>
<el-table-column
prop="priceCode"
label="价格编号"
prop="productName"
label="商品名称"
align="left"
sortable="custom"
>
</el-table-column>
>
<el-table-column
prop="recoveryPrice"
label="回收价"
align="left"
sortable="custom"
>
</el-table-column>
<el-table-column
prop="buinessId"
label="报价方"
prop="unit"
label="单位"
align="left"
sortable="custom"
>
</el-table-column>
<el-table-column
prop="stationName"
label="服务站"
align="left"
sortable="custom"
>
</el-table-column>
<el-table-column
prop="priceStatus"
label="状态"
align="left"
sortable="custom"
>
</el-table-column>
<el-table-column
prop="priceCode"
label="价格编码"
align="left"
sortable="custom"
>
</el-table-column>
<!-- <el-table-column
prop="priceCode"
label="价格编号"
align="left"
sortable="custom"
>
</el-table-column> -->
<!-- <el-table-column
prop="buinessId"
label="报价方"
align="left"
sortable="custom"
>
</el-table-column> -->
<!-- <el-table-column
label="价格类型"
prop="priceType"
algin="left"
@ -170,9 +208,9 @@
<template slot-scope="scope">
{{ scope.row.priceType }}
</template>
</el-table-column>
</el-table-column> -->
<el-table-column
prop="creatorUserId"
prop="creatorUserIds"
label="创建用户"
align="left"
sortable="custom"
@ -185,6 +223,20 @@
sortable="custom"
>
</el-table-column>
<el-table-column
prop="lastModifyUserIds"
label="更新人"
align="left"
sortable="custom"
>
</el-table-column>
<el-table-column
prop="lastModifyTime"
label="更新时间"
align="left"
sortable="custom"
>
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button
@ -193,6 +245,23 @@
v-has="'btn_edit'"
>编辑
</el-button>
<el-button
v-if="scope.row.status == 1"
type="text"
@click="addends(scope.row.id)"
v-has="'btn_ends'"
>失效
</el-button>
<el-button
v-if="scope.row.status == 2"
type="text"
@click="addOstarts(scope.row.id)"
v-has="'btn_starts'"
>生效
</el-button>
<el-button
type="text"
class="JNPF-table-delBtn"
@ -283,6 +352,8 @@ export default {
uploadBoxVisible: false,
detailVisible: false,
query: {
productName: undefined,
stationName: undefined,
priceCode: undefined,
buinessId: undefined,
priceType: undefined,
@ -550,6 +621,49 @@ export default {
})
.catch(() => {});
},
addends(id) {
this.$confirm("此操作将失效, 是否继续?", "提示", {
type: "warning",
})
.then(() => {
request({
url: `/api/scm/NxPrice/closestatus/${id}`,
method: "Post",
}).then((res) => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
},
});
});
})
.catch(() => {});
},
addOstarts(id) {
this.$confirm("此操作将生效, 是否继续?", "提示", {
type: "warning",
})
.then(() => {
request({
url: `/api/scm/NxPrice/closestatus/${id}`,
method: "Post",
}).then((res) => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
},
});
});
})
.catch(() => {});
},
handelUpload() {
this.uploadBoxVisible = true;
this.$nextTick(() => {

Loading…
Cancel
Save