From 451eada4d42593de866b6fe150129ec12079a452 Mon Sep 17 00:00:00 2001 From: Fancy <Fancy.fx@outlook.com> Date: 星期四, 17 十月 2024 11:46:24 +0800 Subject: [PATCH] command --- pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandCtrl.java | 14 +++---- pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandSv.java | 27 ++++++++++++- pms-parent/pms-global/src/main/resources/mapper/TstCommandMapper.xml | 24 ++++++------ pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/QueryVo.java | 4 +- 4 files changed, 45 insertions(+), 24 deletions(-) diff --git a/pms-parent/pms-global/src/main/resources/mapper/TstCommandMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/TstCommandMapper.xml index 25e5e6c..553b47c 100644 --- a/pms-parent/pms-global/src/main/resources/mapper/TstCommandMapper.xml +++ b/pms-parent/pms-global/src/main/resources/mapper/TstCommandMapper.xml @@ -51,14 +51,14 @@ <if test="name != null and name !=''"> name like concat('%', #{name}, '%') and </if> - <if test="factory != null and factory !=''"> - factory like concat('%', #{factory}, '%') and + <if test="proId != null"> + proId = #{proId,jdbcType=BIGINT} </if> - <if test="director != null and director !=''"> - director like concat('%', #{director}, '%') and + <if test="value != null and value !=''"> + value like concat('%', #{value}, '%') and </if> - <if test="dMobile != null and dMobile !=''"> - d_mobile = #{dMobile,jdbcType=VARCHAR} and + <if test="type != null"> + type = #{type,jdbcType=TINYINT} and </if> </trim> order by id desc @@ -76,14 +76,14 @@ <if test="name != null and name !=''"> name like concat('%', #{name}, '%') and </if> - <if test="factory != null and factory !=''"> - factory like concat('%', #{factory}, '%') and + <if test="proId != null"> + proId = #{proId,jdbcType=BIGINT} </if> - <if test="director != null and director !=''"> - director like concat('%', #{director}, '%') and + <if test="value != null and value !=''"> + value like concat('%', #{value}, '%') and </if> - <if test="dMobile != null and dMobile !=''"> - d_mobile = #{dMobile,jdbcType=VARCHAR} and + <if test="type != null"> + type = #{type,jdbcType=TINYINT} and </if> </trim> </select> diff --git a/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandCtrl.java b/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandCtrl.java index f08f0a1..6dc2aad 100644 --- a/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandCtrl.java +++ b/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandCtrl.java @@ -34,11 +34,9 @@ * @return */ @PostMapping(path="save") - @SsoPowerAop(power = "10300005") + @SsoPowerAop(power = "-1") @Log("淇濆瓨鎸囦护") public BaseResponse<Boolean> save(@RequestBody @Valid TstCommand command){ - command.disabled = false; - command.deleted = false; int count = sv.save(command); if (count <= 0) { return BaseResponseUtils.buildFail("鏁版嵁搴撳瓨鍌ㄥけ璐�"); @@ -53,7 +51,7 @@ * @return */ @PostMapping(path="update") - @SsoPowerAop(power = "10300005") + @SsoPowerAop(power = "-1") @Log("鏇存柊鎸囦护") public BaseResponse<Boolean> update(@RequestBody @Valid TstCommand command){ int count = sv.update(command); @@ -70,7 +68,7 @@ * @return */ @GetMapping(path="delete") - @SsoPowerAop(power = "10300005") + @SsoPowerAop(power = "-1") @Log("鍒犻櫎鎸囦护") public BaseResponse<Boolean> delete(String id){ int count = sv.delete(Long.parseLong(id)); @@ -86,7 +84,7 @@ * @return */ @GetMapping(path="one") - @SsoPowerAop(power = "10300004") //鐧诲綍涓庢潈闄愬悓鏃堕獙璇� + @SsoPowerAop(power = "-1") //鐧诲綍涓庢潈闄愬悓鏃堕獙璇� @Log("鏍规嵁ID鏌ヨ鎸囦护") public BaseResponse<TstCommand> one(String id){ TstCommand param=sv.selectById(id); @@ -99,7 +97,7 @@ * @return */ @PostMapping(path="some") - @SsoPowerAop(power = "10300004") + @SsoPowerAop(power = "-1") @Log("鍒嗛〉鏌ヨ鎸囦护") public BaseResponse<QueryResultVo<List<TstCommand>>> some(@RequestBody QueryVo vo){ QueryResultVo<List<TstCommand>> list = sv.selectSome(vo) ; @@ -111,7 +109,7 @@ * @return */ @GetMapping(path="all") - @SsoPowerAop(power = "10300004") + @SsoPowerAop(power = "-1") @Log("鏌ヨ鎵�鏈夋寚浠�") public BaseResponse<List<TstCommand>> all(){ List<TstCommand> list = sv.selectAll(); diff --git a/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandSv.java b/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandSv.java index 41d145f..9d61035 100644 --- a/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandSv.java +++ b/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/CommandSv.java @@ -1,14 +1,20 @@ package com.dy.pmsTest.command; +import com.dy.common.webFilter.UserTokenContext; import com.dy.common.webUtil.QueryResultVo; +import com.dy.pmsGlobal.daoPr.PrOrderItemMapper; +import com.dy.pmsGlobal.daoPr.PrOrderMapper; import com.dy.pmsGlobal.daoTst.TstCommandMapper; +import com.dy.pmsGlobal.pojoBa.BaUser; import com.dy.pmsGlobal.pojoTst.TstCommand; +import com.dy.pmsGlobal.util.UserUtil; import lombok.extern.slf4j.Slf4j; import org.apache.dubbo.common.utils.PojoUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Date; import java.util.List; import java.util.Map; @@ -16,10 +22,15 @@ @Service public class CommandSv { private TstCommandMapper dao; + private UserUtil userUtil; @Autowired public void setDao(TstCommandMapper dao) { this.dao = dao; + } + @Autowired + public void setUserUtil(UserUtil userUtil) { + this.userUtil = userUtil; } @Transactional @@ -27,6 +38,13 @@ if(dao.selectByNameId(command.id,command.proId,command.name)>0){ throw new RuntimeException("鎸囦护鍚嶇О宸插瓨鍦�"); } + command.disabled = false; + command.deleted = false; + /* BaUser loginUser = userUtil.getUser(UserTokenContext.get()); + if (loginUser != null) { + command.createBy = loginUser.id; + }*/ + command.createDate = new Date(); int count = dao.insertSelective(command); return count; } @@ -47,12 +65,17 @@ if(dao.selectByNameId(command.id,command.proId,command.name)>0){ throw new RuntimeException("鎸囦护鍚嶇О宸插瓨鍦�"); } + /* BaUser loginUser = userUtil.getUser(UserTokenContext.get()); + if (loginUser != null) { + command.updatedBy = loginUser.id; + }*/ + command.updatedDate = new Date(); int count = dao.updateByPrimaryKeySelective(command); return count; } - public TstCommand selectById(String lineId) { - return dao.selectByPrimaryKey(Long.valueOf(lineId)); + public TstCommand selectById(String id) { + return dao.selectByPrimaryKey(Long.valueOf(id)); } /** diff --git a/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/QueryVo.java b/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/QueryVo.java index 7131091..18b91d2 100644 --- a/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/QueryVo.java +++ b/pms-parent/pms-test/src/main/java/com/dy/pmsTest/command/QueryVo.java @@ -12,7 +12,7 @@ public class QueryVo extends QueryConditionVo { public String name; - public String proId; - public String type; + public Long proId; + public Integer type; public String value; } -- Gitblit v1.8.0