提交价格列表中心

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

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

@ -2,6 +2,76 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.NxPriceMapper"> <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> </mapper>

@ -1,8 +1,14 @@
package jnpf.mapper; 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 jnpf.entity.NxPriceEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import jnpf.model.nxprice.NxPricePagination;
import jnpf.model.nxproduct.NxProductPagination;
import org.apache.ibatis.annotations.Param;
/** /**
* nxPrice * nxPrice
@ -13,4 +19,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface NxPriceMapper extends BaseMapper<NxPriceEntity> { 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; private NxPriceProductService nxPriceProductService;
@Autowired @Autowired
private NxPriceRecycleService nxPriceRecycleService; private NxPriceRecycleService nxPriceRecycleService;
@Autowired
private NxPriceMapper nxPriceMapper;
@Override @Override
public List<NxPriceEntity> getList(NxPricePagination nxPricePagination){ public List<NxPriceEntity> getList(NxPricePagination nxPricePagination){
return getTypeList(nxPricePagination,nxPricePagination.getDataType()); return getTypeList(nxPricePagination,nxPricePagination.getDataType());
@ -232,7 +234,31 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
String value = nxPricePagination.getPriceCode() instanceof List ? String value = nxPricePagination.getPriceCode() instanceof List ?
JsonUtil.getObjectToString(nxPricePagination.getPriceCode()) : JsonUtil.getObjectToString(nxPricePagination.getPriceCode()) :
String.valueOf(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())){ if(ObjectUtil.isNotEmpty(nxPricePagination.getCreatorUserId())){
nxPriceNum++; 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 fir = Long.valueOf(String.valueOf(CreatorTimeList.get(0)));
Long sec = Long.valueOf(String.valueOf(CreatorTimeList.get(1))); Long sec = Long.valueOf(String.valueOf(CreatorTimeList.get(1)));
nxPriceQueryWrapper.lambda().ge(NxPriceEntity::getCreatorTime, new Date(fir)) // nxPriceQueryWrapper.lambda().ge(NxPriceEntity::getCreatorTime, new Date(fir))
.le(NxPriceEntity::getCreatorTime, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59")); 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){ if (intersection.size()==0){
intersection.add("jnpfNullList"); intersection.add("jnpfNullList");
} }
nxPriceQueryWrapper.lambda().in(NxPriceEntity::getId, intersection); nxPriceQueryWrapper.in("a.id", intersection);
} }
//是否有高级查询 //是否有高级查询
if (StringUtil.isNotEmpty(superOp)){ if (StringUtil.isNotEmpty(superOp)){
@ -346,7 +373,7 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
allSuperIDlist.add("jnpfNullList"); allSuperIDlist.add("jnpfNullList");
} }
List<String> finalAllSuperIDlist = allSuperIDlist; 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)){ if (StringUtil.isNotEmpty(ruleOp)){
@ -354,14 +381,16 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
allRuleIDlist.add("jnpfNullList"); allRuleIDlist.add("jnpfNullList");
} }
List<String> finalAllRuleIDlist = allRuleIDlist; 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())){ 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{ }else{
try { try {
String sidx = nxPricePagination.getSidx(); String sidx = nxPricePagination.getSidx();
@ -370,7 +399,9 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
Field declaredField = nxPriceEntity.getClass().getDeclaredField(strs[0]); Field declaredField = nxPriceEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true); declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value(); 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) { } catch (NoSuchFieldException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -379,7 +410,9 @@ public class NxPriceServiceImpl extends ServiceImpl<NxPriceMapper, NxPriceEntity
if("0".equals(dataType)){ if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){ if((total>0 && AllIdList.size()>0) || total==0){
Page<NxPriceEntity> page=new Page<>(nxPricePagination.getCurrentPage(), nxPricePagination.getPageSize()); 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()); return nxPricePagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{ }else{
List<NxPriceEntity> list = new ArrayList(); List<NxPriceEntity> list = new ArrayList();

@ -103,7 +103,7 @@ public class NxPriceController {
realList.add(nxPriceMap); 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(); PageListVO vo = new PageListVO();
@ -335,6 +335,36 @@ public class NxPriceController {
return ActionResult.fail("更新失败,数据不存在"); 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 * @param id

@ -44,4 +44,27 @@ public class NxPriceEntity {
private String flowId; private String flowId;
@TableField("F_VERSION") @TableField("F_VERSION")
private Integer 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") @JsonProperty("creatorTime")
private Object creatorTime; private Object creatorTime;
/** 商品名称 */
@JsonProperty("productName")
private Object productName;
/** 回收站 */
@JsonProperty("stationName")
private Object stationName;
} }

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

@ -1,10 +1,4 @@
<template> <template>
<div class="JNPF-common-layout"> <div class="JNPF-common-layout">
<div class="JNPF-common-layout-center"> <div class="JNPF-common-layout-center">
@ -20,31 +14,29 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="报价方"> <el-form-item label="商品名称">
<JnpfOrganizeSelect <el-input
selectType="all" v-model="query.productName"
v-model="query.buinessId" placeholder="请输入"
placeholder="请选择
"
clearable clearable
multiple >
/> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="价格类型"> <el-form-item label="回收站">
<JnpfSelect <el-input
v-model="query.priceType" v-model="query.stationName"
placeholder="请选择" placeholder="请输入"
clearable clearable
:options="priceTypeOptions"
:props="priceTypeProps"
multiple
> >
</JnpfSelect> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<template v-if="showAll"> <template v-if="showAll">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="创建用户"> <el-form-item label="创建用户">
@ -148,20 +140,66 @@
:span-method="arraySpanMethod" :span-method="arraySpanMethod"
> >
<el-table-column <el-table-column
prop="priceCode" prop="productName"
label="价格编号" label="商品名称"
align="left" align="left"
sortable="custom" sortable="custom"
> >
</el-table-column> </el-table-column>
>
<el-table-column <el-table-column
prop="buinessId" prop="recoveryPrice"
label="报价方" label="回收价"
align="left"
sortable="custom"
>
</el-table-column>
<el-table-column
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" align="left"
sortable="custom" sortable="custom"
> >
</el-table-column> </el-table-column>
<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="价格类型" label="价格类型"
prop="priceType" prop="priceType"
algin="left" algin="left"
@ -170,9 +208,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.priceType }} {{ scope.row.priceType }}
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
prop="creatorUserId" prop="creatorUserIds"
label="创建用户" label="创建用户"
align="left" align="left"
sortable="custom" sortable="custom"
@ -185,6 +223,20 @@
sortable="custom" sortable="custom"
> >
</el-table-column> </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"> <el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -193,6 +245,23 @@
v-has="'btn_edit'" v-has="'btn_edit'"
>编辑 >编辑
</el-button> </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 <el-button
type="text" type="text"
class="JNPF-table-delBtn" class="JNPF-table-delBtn"
@ -283,6 +352,8 @@ export default {
uploadBoxVisible: false, uploadBoxVisible: false,
detailVisible: false, detailVisible: false,
query: { query: {
productName: undefined,
stationName: undefined,
priceCode: undefined, priceCode: undefined,
buinessId: undefined, buinessId: undefined,
priceType: undefined, priceType: undefined,
@ -550,6 +621,49 @@ export default {
}) })
.catch(() => {}); .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() { handelUpload() {
this.uploadBoxVisible = true; this.uploadBoxVisible = true;
this.$nextTick(() => { this.$nextTick(() => {

Loading…
Cancel
Save