kangwei:解决禅道bug
正在显示
9 个修改的文件
包含
73 行增加
和
39 行删除
1 | package com.skua.modules.erp.controller; | 1 | package com.skua.modules.erp.controller; |
2 | 2 | ||
3 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 3 | |
4 | import com.baomidou.mybatisplus.core.metadata.IPage; | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
6 | import com.skua.core.api.vo.Result; | 6 | import com.skua.core.api.vo.Result; |
7 | import com.skua.core.aspect.annotation.AutoLog; | 7 | import com.skua.core.aspect.annotation.AutoLog; |
8 | import com.skua.core.context.BaseContextHandler; | 8 | import com.skua.core.context.BaseContextHandler; |
9 | import com.skua.core.query.QueryGenerator; | ||
10 | import com.skua.core.util.ConvertUtils; | ||
11 | import com.skua.core.util.DateUtils; | 9 | import com.skua.core.util.DateUtils; |
12 | import com.skua.modules.equipment.service.IEquipmentSparepartService; | ||
13 | import com.skua.modules.erp.entity.ApproveRecord; | ||
14 | import com.skua.modules.erp.entity.PurchaseMaterial; | 10 | import com.skua.modules.erp.entity.PurchaseMaterial; |
15 | import com.skua.modules.erp.service.IDistributMaterialService; | ||
16 | import com.skua.modules.erp.service.IPurchaseMaterialService; | 11 | import com.skua.modules.erp.service.IPurchaseMaterialService; |
17 | import com.skua.modules.erp.vo.MaterialSearchVO; | 12 | import com.skua.modules.erp.vo.MaterialSearchVO; |
18 | import com.skua.modules.erp.vo.PurchaseMaterialVO; | 13 | import com.skua.modules.erp.vo.PurchaseMaterialVO; |
19 | import com.skua.modules.guest.util.DateUtil; | ||
20 | import com.skua.modules.quartz.util.BaseUtil; | 14 | import com.skua.modules.quartz.util.BaseUtil; |
21 | import com.skua.modules.supplies.entity.EquipmentSparepartSupplies; | 15 | import com.skua.modules.supplies.entity.EquipmentSparepartSupplies; |
22 | import com.skua.modules.supplies.entity.EquipmentSparepartType; | 16 | import com.skua.modules.supplies.entity.EquipmentSparepartType; |
23 | import com.skua.modules.supplies.service.IEquipmentSparepartSuppliesService; | 17 | import com.skua.modules.supplies.service.IEquipmentSparepartSuppliesService; |
24 | import com.skua.modules.supplies.service.IEquipmentSparepartTypeService; | 18 | import com.skua.modules.supplies.service.IEquipmentSparepartTypeService; |
25 | import com.skua.modules.system.entity.SysUser; | ||
26 | import com.skua.tool.dfs.MapDFS; | ||
27 | import io.swagger.annotations.Api; | 19 | import io.swagger.annotations.Api; |
28 | import io.swagger.annotations.ApiOperation; | 20 | import io.swagger.annotations.ApiOperation; |
29 | import lombok.extern.slf4j.Slf4j; | 21 | import lombok.extern.slf4j.Slf4j; | ... | ... |
... | @@ -18,10 +18,7 @@ import com.skua.modules.erp.service.IErpSettlementService; | ... | @@ -18,10 +18,7 @@ import com.skua.modules.erp.service.IErpSettlementService; |
18 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 18 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
19 | import com.baomidou.mybatisplus.core.metadata.IPage; | 19 | import com.baomidou.mybatisplus.core.metadata.IPage; |
20 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 20 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
21 | import com.skua.modules.erp.vo.ErpSettlementFormVO; | 21 | import com.skua.modules.erp.vo.*; |
22 | import com.skua.modules.erp.vo.ErpSettlementItemVO; | ||
23 | import com.skua.modules.erp.vo.ErpSettlementVO; | ||
24 | import com.skua.modules.erp.vo.SparepartSettlementVO; | ||
25 | import com.skua.modules.productionduty.utils.HolidaysUtils; | 22 | import com.skua.modules.productionduty.utils.HolidaysUtils; |
26 | import com.skua.tool.util.JSUtils; | 23 | import com.skua.tool.util.JSUtils; |
27 | import lombok.extern.slf4j.Slf4j; | 24 | import lombok.extern.slf4j.Slf4j; |
... | @@ -52,13 +49,30 @@ public class ErpSettlementController { | ... | @@ -52,13 +49,30 @@ public class ErpSettlementController { |
52 | @AutoLog(value = "药剂结算单详情-分页列表查询") | 49 | @AutoLog(value = "药剂结算单详情-分页列表查询") |
53 | @ApiOperation(value="药剂结算单详情-分页列表查询(settlementType = 0 供应商结算集合,settlementType= 1 水厂结算)", notes="药剂结算单详情-分页列表查询") | 50 | @ApiOperation(value="药剂结算单详情-分页列表查询(settlementType = 0 供应商结算集合,settlementType= 1 水厂结算)", notes="药剂结算单详情-分页列表查询") |
54 | @GetMapping(value = "/list") | 51 | @GetMapping(value = "/list") |
55 | public Result<IPage<ErpSettlement>> queryPageList(ErpSettlement erpSettlement, | 52 | public Result<IPage<ErpSettlement>> queryPageList(ErpSettlementSearchVO erpSettlementSearchVO, |
56 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, | 53 | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
57 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, | 54 | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
58 | HttpServletRequest req) { | 55 | HttpServletRequest req) { |
59 | Result<IPage<ErpSettlement>> result = new Result<IPage<ErpSettlement>>(); | 56 | Result<IPage<ErpSettlement>> result = new Result<IPage<ErpSettlement>>(); |
60 | QueryWrapper<ErpSettlement> queryWrapper = QueryGenerator.initQueryWrapper(erpSettlement, req.getParameterMap()); | 57 | QueryWrapper<ErpSettlement> queryWrapper = new QueryWrapper();// QueryGenerator.initQueryWrapper(erpSettlement, req.getParameterMap()); |
61 | Page<ErpSettlement> page = new Page<ErpSettlement>(pageNo, pageSize); | 58 | Page<ErpSettlement> page = new Page<ErpSettlement>(pageNo, pageSize); |
59 | |||
60 | if(StringUtils.isNotEmpty(erpSettlementSearchVO.getDepartId())){ | ||
61 | queryWrapper.eq("depart_id" ,erpSettlementSearchVO.getDepartId()) ; | ||
62 | } | ||
63 | if(StringUtils.isNotEmpty(erpSettlementSearchVO.getSupplierId())){ | ||
64 | queryWrapper.eq("supplier_id" ,erpSettlementSearchVO.getSupplierId()) ; | ||
65 | } | ||
66 | String startDate = req.getParameter("startDate"); | ||
67 | if(StringUtils.isNotEmpty(startDate)){ | ||
68 | startDate = startDate+" 00:00:00"; | ||
69 | queryWrapper.ge("settlement_time",startDate); | ||
70 | } | ||
71 | String endDate = req.getParameter("endDate"); | ||
72 | if(StringUtils.isNotEmpty(endDate)){ | ||
73 | endDate = endDate+" 23:59:59"; | ||
74 | queryWrapper.le("settlement_time",endDate ); | ||
75 | } | ||
62 | IPage<ErpSettlement> pageList = erpSettlementService.page(page, queryWrapper); | 76 | IPage<ErpSettlement> pageList = erpSettlementService.page(page, queryWrapper); |
63 | result.setSuccess(true); | 77 | result.setSuccess(true); |
64 | result.setResult(pageList); | 78 | result.setResult(pageList); |
... | @@ -180,6 +194,8 @@ public class ErpSettlementController { | ... | @@ -180,6 +194,8 @@ public class ErpSettlementController { |
180 | erpSettlementVO.setApproverSign(BaseContextHandler.getUserName()); | 194 | erpSettlementVO.setApproverSign(BaseContextHandler.getUserName()); |
181 | } | 195 | } |
182 | erpSettlementService.saveSettlement(erpSettlementVO); | 196 | erpSettlementService.saveSettlement(erpSettlementVO); |
197 | //修改药剂入库的状态 | ||
198 | erpSettlementService.updateMaterialInSettlementFlag( erpSettlementVO,"1"); | ||
183 | result.success("添加成功!"); | 199 | result.success("添加成功!"); |
184 | } catch (Exception e) { | 200 | } catch (Exception e) { |
185 | log.error(e.getMessage(),e); | 201 | log.error(e.getMessage(),e); |
... | @@ -255,8 +271,9 @@ public class ErpSettlementController { | ... | @@ -255,8 +271,9 @@ public class ErpSettlementController { |
255 | result.error500("未找到对应实体"); | 271 | result.error500("未找到对应实体"); |
256 | }else { | 272 | }else { |
257 | //修改 入库表状态 | 273 | //修改 入库表状态 |
258 | boolean ok = erpSettlementService.settlement(erpSettlementEntity); | 274 | boolean ok = erpSettlementService.updateById(erpSettlementEntity); |
259 | if(ok) { | 275 | if(ok) { |
276 | erpSettlementService.updateMaterialInSettlementFlag( erpSettlementEntity,"2"); | ||
260 | result.success("结算成功!"); | 277 | result.success("结算成功!"); |
261 | } | 278 | } |
262 | } | 279 | } | ... | ... |
... | @@ -208,10 +208,10 @@ public class MaterialIN { | ... | @@ -208,10 +208,10 @@ public class MaterialIN { |
208 | @ApiModelProperty(value = "出库编号") | 208 | @ApiModelProperty(value = "出库编号") |
209 | private String equipmentOutId; | 209 | private String equipmentOutId; |
210 | 210 | ||
211 | @ApiModelProperty(value = "供应商结算,0:未结算,1:已结算") | 211 | @ApiModelProperty(value = "供应商结算,0:未结算,1::已申请,2:已结算") |
212 | private Integer supplierSettlementFlag; | 212 | private Integer supplierSettlementFlag; |
213 | 213 | ||
214 | @ApiModelProperty(value = "水厂结算,0:未结算,1:已结算") | 214 | @ApiModelProperty(value = "水厂结算,0:未结算,1:已申请,2:已结算") |
215 | private Integer waterDepartSettlementFlag; | 215 | private Integer waterDepartSettlementFlag; |
216 | 216 | ||
217 | } | 217 | } | ... | ... |
... | @@ -54,12 +54,12 @@ | ... | @@ -54,12 +54,12 @@ |
54 | select pc.id 'purchase_contract_id', pc.contract_code 'purchase_contract_code' , st.item_text as 'sparepart_type_name', | 54 | select pc.id 'purchase_contract_id', pc.contract_code 'purchase_contract_code' , st.item_text as 'sparepart_type_name', |
55 | (select sum(mi.material_num) from erp_material_in mi where mi.audit_status = 3 and mi.good_code = aaa.good_code) 'storeNum',aaa.* | 55 | (select sum(mi.material_num) from erp_material_in mi where mi.audit_status = 3 and mi.good_code = aaa.good_code) 'storeNum',aaa.* |
56 | from ( | 56 | from ( |
57 | select dc.contract_code 'distribut_contract_code', dc.id 'distribut_contract_id', dm.distribut_price ,dm.distribut_total_price,dm.material_num 'distribut_num',pm.* | 57 | select dc.contract_code 'distribut_contract_code', dc.id 'distribut_contract_id', dm.distribut_price ,dm.distribut_total_price,dm.material_num ,pm.* |
58 | from erp_distribut_contract dc , erp_distribut_material dm , erp_purchase_material pm | 58 | from erp_distribut_contract dc , erp_distribut_material dm , erp_purchase_material pm |
59 | where dc.id = dm.contract_id and dc.id = #{param.distributContractId } and dm.good_code = pm.good_code and pm.del_flag = 0 and dc.use_flag = '0' | 59 | where dc.id = dm.contract_id and dc.id = #{param.distributContractId } and dm.good_code = pm.good_code and pm.del_flag = 0 and dc.use_flag = '0' |
60 | <if test="param.sparepartCode != null and param.sparepartCode !=''">and pm.sparepart_code =#{param.sparepartCode}</if> | 60 | <if test="param.sparepartCode != null and param.sparepartCode !=''">and pm.sparepart_code =#{param.sparepartCode}</if> |
61 | <if test="param.sparepartType != null and param.sparepartType !=''">and pm.sparepart_type in (${param.sparepartType}) </if> | 61 | <if test="param.sparepartType != null and param.sparepartType !=''">and pm.sparepart_type in (${param.sparepartType}) </if> |
62 | <if test="param.sparepartName != null and param.sparepartName !=''">and pm.sparepart_name like '%' #{param.sparepartName}'%'</if> | 62 | <if test="param.sparepartName != null and param.sparepartName !=''">and pm.sparepart_name like '%${param.sparepartName}%'</if> |
63 | )aaa | 63 | )aaa |
64 | left join erp_purchase_contract pc on pc.id = aaa.contract_id | 64 | left join erp_purchase_contract pc on pc.id = aaa.contract_id |
65 | left join equipment_sparepart_type st on st.id = aaa.sparepart_type | 65 | left join equipment_sparepart_type st on st.id = aaa.sparepart_type | ... | ... |
... | @@ -53,7 +53,7 @@ | ... | @@ -53,7 +53,7 @@ |
53 | <if test="ev.sparepartType != null and ev.sparepartType != '' "> | 53 | <if test="ev.sparepartType != null and ev.sparepartType != '' "> |
54 | and pi.sparepart_type = #{ev.sparepartType} | 54 | and pi.sparepart_type = #{ev.sparepartType} |
55 | </if> <if test="ev.sparepartName != null and ev.sparepartName != '' "> | 55 | </if> <if test="ev.sparepartName != null and ev.sparepartName != '' "> |
56 | AND pi.sparepart_name like '%'#{ev.sparepartName}'%' | 56 | AND pi.sparepart_name like '%${ev.sparepartName}%' |
57 | </if> | 57 | </if> |
58 | <if test="ev.applyYear != null and ev.applyYear != '' "> | 58 | <if test="ev.applyYear != null and ev.applyYear != '' "> |
59 | and pp.apply_year = #{ev.applyYear} | 59 | and pp.apply_year = #{ev.applyYear} |
... | @@ -67,6 +67,7 @@ | ... | @@ -67,6 +67,7 @@ |
67 | <if test="ev.endTime != null and ev.endTime != ''"> | 67 | <if test="ev.endTime != null and ev.endTime != ''"> |
68 | and pp.apply_time <= #{ev.endTime} | 68 | and pp.apply_time <= #{ev.endTime} |
69 | </if> | 69 | </if> |
70 | order by pp.apply_time desc | ||
70 | </select> | 71 | </select> |
71 | <!-- and pp.depart_id in (#{ev.departs})--> | 72 | <!-- and pp.depart_id in (#{ev.departs})--> |
72 | </mapper> | 73 | </mapper> | ... | ... |
... | @@ -43,8 +43,8 @@ public interface IErpSettlementService extends IService<ErpSettlement> { | ... | @@ -43,8 +43,8 @@ public interface IErpSettlementService extends IService<ErpSettlement> { |
43 | //水厂结算 | 43 | //水厂结算 |
44 | List<ErpSettlementVO> waterDepartSettlement(String materialInIds); | 44 | List<ErpSettlementVO> waterDepartSettlement(String materialInIds); |
45 | 45 | ||
46 | /***结算*/ | 46 | /***结算:修改 药剂入库结算状态*/ |
47 | boolean settlement(ErpSettlement erpSettlementEntity); | 47 | boolean updateMaterialInSettlementFlag(ErpSettlement erpSettlementEntity,String settlementFlag); |
48 | 48 | ||
49 | // (供应商)送货单以及物资验收单 | 49 | // (供应商)送货单以及物资验收单 |
50 | // ErpSettlementFormVO querySupplierSettlementFormById(String id); | 50 | // ErpSettlementFormVO querySupplierSettlementFormById(String id); | ... | ... |
... | @@ -145,20 +145,20 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E | ... | @@ -145,20 +145,20 @@ public class ErpSettlementServiceImpl extends ServiceImpl<ErpSettlementMapper, E |
145 | public List<ErpSettlementVO> waterDepartSettlement(String materialInIds){ | 145 | public List<ErpSettlementVO> waterDepartSettlement(String materialInIds){ |
146 | return this.baseMapper.waterDepartSettlement( materialInIds ); | 146 | return this.baseMapper.waterDepartSettlement( materialInIds ); |
147 | } | 147 | } |
148 | /***结算*/ | 148 | |
149 | @Transactional | 149 | |
150 | public boolean settlement(ErpSettlement erpSettlementEntity){ | 150 | //修改药剂入库的结算状态 |
151 | public boolean updateMaterialInSettlementFlag(ErpSettlement erpSettlementEntity,String settlementFlag){ | ||
151 | String sql = null; | 152 | String sql = null; |
152 | if("0".equals( erpSettlementEntity.getSettlementType() )){//供应商结算 | 153 | if("0".equals( erpSettlementEntity.getSettlementType() )){//供应商结算 |
153 | sql = "update erp_material_in mi set mi.supplier_settlement_flag = 1 where mi.id in ( select material_in_id from erp_settlement_item si where si.settlement_id = '"+erpSettlementEntity.getId()+"')"; | 154 | sql = "update erp_material_in mi set mi.supplier_settlement_flag = "+settlementFlag+" where mi.id in ( select material_in_id from erp_settlement_item si where si.settlement_id = '"+erpSettlementEntity.getId()+"')"; |
154 | } | 155 | } |
155 | if("1".equals( erpSettlementEntity.getSettlementType() )){//水厂结算 | 156 | if("1".equals( erpSettlementEntity.getSettlementType() )){//水厂结算 |
156 | sql = "update erp_material_in mi set mi.water_depart_settlement_flag = 1 where mi.id in ( select material_in_id from erp_settlement_item si where si.settlement_id = '"+erpSettlementEntity.getId()+"')"; | 157 | sql = "update erp_material_in mi set mi.water_depart_settlement_flag = "+settlementFlag+" where mi.id in ( select material_in_id from erp_settlement_item si where si.settlement_id = '"+erpSettlementEntity.getId()+"')"; |
157 | } | 158 | } |
158 | if(StringUtils.isNotEmpty(sql)){ | 159 | if(StringUtils.isNotEmpty(sql)){ |
159 | commonSqlService.update(sql); | 160 | commonSqlService.update(sql); |
160 | } | 161 | } |
161 | this.baseMapper.updateById( erpSettlementEntity ); | ||
162 | return true; | 162 | return true; |
163 | } | 163 | } |
164 | 164 | ... | ... |
1 | package com.skua.modules.erp.vo; | ||
2 | |||
3 | import io.swagger.annotations.ApiModelProperty; | ||
4 | import lombok.Data; | ||
5 | |||
6 | /** | ||
7 | * @auther kangwei | ||
8 | * @create 2024-11-29-13:37 | ||
9 | */ | ||
10 | @Data | ||
11 | public class ErpSettlementSearchVO { | ||
12 | /**供应商id*/ | ||
13 | @ApiModelProperty(value = "供应商id") | ||
14 | private String supplierId; | ||
15 | /**水厂编号*/ | ||
16 | @ApiModelProperty(value = "水厂编号") | ||
17 | private String departId; | ||
18 | |||
19 | @ApiModelProperty(value = "开始时间") | ||
20 | private String startDate; | ||
21 | |||
22 | @ApiModelProperty(value = "结束时间") | ||
23 | private String endDate; | ||
24 | } |
sk-module-equipment/src/main/java/com/skua/modules/equipment/mapper/xml/EquipmentSparepartMapper.xml
... | @@ -12,11 +12,11 @@ | ... | @@ -12,11 +12,11 @@ |
12 | left join sys_depart d on sw.depart_id = d.id | 12 | left join sys_depart d on sw.depart_id = d.id |
13 | where es.supplies_warehouse_id = sw.id and sw.depart_id in (${param.departIds}) | 13 | where es.supplies_warehouse_id = sw.id and sw.depart_id in (${param.departIds}) |
14 | <if test="param.suppliesWarehouseId != null and param.suppliesWarehouseId !=''"> and sw.id =#{param.suppliesWarehouseId}</if> | 14 | <if test="param.suppliesWarehouseId != null and param.suppliesWarehouseId !=''"> and sw.id =#{param.suppliesWarehouseId}</if> |
15 | <if test="param.sparepartCode != null and param.sparepartCode !=''">and es.sparepart_code like '%' #{param.sparepartCode}'%'</if> | 15 | <if test="param.sparepartCode != null and param.sparepartCode !=''">and es.sparepart_code like '%${param.sparepartCode}%'</if> |
16 | <if test="param.sparepartType != null and param.sparepartType !=''">and es.sparepart_type in (${param.sparepartType}) </if> | 16 | <if test="param.sparepartType != null and param.sparepartType !=''">and es.sparepart_type in (${param.sparepartType}) </if> |
17 | <if test="param.sparepartName != null and param.sparepartName !=''">and es.sparepart_name like '%' #{param.sparepartName}'%'</if> | 17 | <if test="param.sparepartName != null and param.sparepartName !=''">and es.sparepart_name like '%${param.sparepartName}%'</if> |
18 | <if test="param.specification != null and param.specification !=''">and es.specification like '%' #{param.specification}'%'</if> | 18 | <if test="param.specification != null and param.specification !=''">and es.specification like '%${param.specification}%'</if> |
19 | 19 | <if test="param.sparepartAttribute != null and param.sparepartAttribute !=''">and es.sparepart_attribute like '%${param.sparepartAttribute}%'</if> | |
20 | order by es.inventory_update_time desc | 20 | order by es.inventory_update_time desc |
21 | </select> | 21 | </select> |
22 | 22 | ||
... | @@ -24,9 +24,9 @@ | ... | @@ -24,9 +24,9 @@ |
24 | <select id="queryPageRelationList" resultType="com.skua.modules.equipment.vo.EquipmentSparepartVO" > | 24 | <select id="queryPageRelationList" resultType="com.skua.modules.equipment.vo.EquipmentSparepartVO" > |
25 | select es.* from equipment_relation er , equipment_sparepart es | 25 | select es.* from equipment_relation er , equipment_sparepart es |
26 | where er.sparepart_id = es.id and er.info_id = #{param.infoId} | 26 | where er.sparepart_id = es.id and er.info_id = #{param.infoId} |
27 | <if test="param.sparepartCode != null and param.sparepartCode !=''">and es.sparepart_code like '%' #{param.sparepartCode}'%'</if> | 27 | <if test="param.sparepartCode != null and param.sparepartCode !=''">and es.sparepart_code like '%${param.sparepartCode}%'</if> |
28 | <if test="param.sparepartName != null and param.sparepartName !=''">and es.sparepart_name like '%' #{param.sparepartName}'%'</if> | 28 | <if test="param.sparepartName != null and param.sparepartName !=''">and es.sparepart_name like '%${param.sparepartName}%'</if> |
29 | <if test="param.specification != null and param.specification !=''">and es.specification like '%' #{param.specification}'%'</if> | 29 | <if test="param.specification != null and param.specification !=''">and es.specification like '%${param.specification}%'</if> |
30 | order by es.inventory_update_time desc | 30 | order by es.inventory_update_time desc |
31 | </select> | 31 | </select> |
32 | </mapper> | 32 | </mapper> | ... | ... |
-
请 注册 或 登录 后发表评论