Commit f0fe82cf authored by hezhuozhi's avatar hezhuozhi

Merge remote-tracking branch 'origin/developer' into developer

parents e6e2e585 f462b681
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto; import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
...@@ -29,6 +31,6 @@ public class HygfReplenishmentDto extends BaseDto { ...@@ -29,6 +31,6 @@ public class HygfReplenishmentDto extends BaseDto {
private String comment; private String comment;
@ApiModelProperty(value = "补货文件") @ApiModelProperty(value = "补货文件")
private List<Object> file; private String file;
} }
...@@ -41,6 +41,6 @@ public class HygfReplenishment extends BaseEntity { ...@@ -41,6 +41,6 @@ public class HygfReplenishment extends BaseEntity {
* 补货文件 * 补货文件
*/ */
@TableField(value = "file" , typeHandler = FastjsonTypeHandler.class) @TableField(value = "file" , typeHandler = FastjsonTypeHandler.class)
private String file; private List<Object> file;
} }
package com.yeejoin.amos.boot.module.hygf.api.mapper; package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfReplenishmentDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfReplenishment; import com.yeejoin.amos.boot.module.hygf.api.entity.HygfReplenishment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/** /**
* Mapper 接口 * Mapper 接口
* *
...@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface HygfReplenishmentMapper extends BaseMapper<HygfReplenishment> { public interface HygfReplenishmentMapper extends BaseMapper<HygfReplenishment> {
List<HygfReplenishmentDto> selectData(Long sequenceNbr);
} }
package com.yeejoin.amos.boot.module.hygf.api.mapper; package com.yeejoin.amos.boot.module.hygf.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower; import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold; import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
......
...@@ -2,4 +2,9 @@ ...@@ -2,4 +2,9 @@
<!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="com.yeejoin.amos.boot.module.hygf.api.mapper.HygfReplenishmentMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.HygfReplenishmentMapper">
<select id="selectData" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.HygfReplenishmentDto">
select * from hygf_replenishment where preparation_money_id = #{sequenceNbr}
</select>
</mapper> </mapper>
...@@ -31,7 +31,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan ...@@ -31,7 +31,7 @@ LEFT JOIN hygf_document_station on hygf_document_station.station_id=hygf_peasan
and hygf_preparation_money.amos_unit_id = #{dto.amosUnitId} and hygf_preparation_money.amos_unit_id = #{dto.amosUnitId}
</if> </if>
<if test="dto.flag != null and dto.flag != ''"> <if test="dto.flag != null and dto.flag != ''">
and hygf_preparation_money.delivery_state != "已作废" and hygf_preparation_money.delivery_state != "已作废" and hygf_preparation_money.delivery_state != "待发货"
</if> </if>
<if test="dto.deliveryTimeStart != null and dto.deliveryTimeEnd != ''"> <if test="dto.deliveryTimeStart != null and dto.deliveryTimeEnd != ''">
and hygf_preparation_money.delivery_time between #{dto.deliveryTimeStart} and #{dto.deliveryTimeEnd} and hygf_preparation_money.delivery_time between #{dto.deliveryTimeStart} and #{dto.deliveryTimeEnd}
......
...@@ -19,6 +19,7 @@ import com.yeejoin.amos.feign.privilege.Privilege; ...@@ -19,6 +19,7 @@ import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.CompanyModel; import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -47,6 +48,7 @@ import java.util.stream.Collectors; ...@@ -47,6 +48,7 @@ import java.util.stream.Collectors;
@RestController @RestController
@Api(tags = "Api") @Api(tags = "Api")
@RequestMapping(value = "/household-contract") @RequestMapping(value = "/household-contract")
@Slf4j
public class HouseholdContractController extends BaseController { public class HouseholdContractController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(HouseholdContractController.class); private static final Logger logger = LoggerFactory.getLogger(HouseholdContractController.class);
@Autowired @Autowired
...@@ -319,6 +321,7 @@ public class HouseholdContractController extends BaseController { ...@@ -319,6 +321,7 @@ public class HouseholdContractController extends BaseController {
try { try {
householdContract = householdContractServiceImpl.reissueinitiateHouseholdContract(model); householdContract = householdContractServiceImpl.reissueinitiateHouseholdContract(model);
}catch (Exception e){ }catch (Exception e){
log.error("重新发起合同错误, 入参: {}, error:", JSON.toJSONString(model), e);
throw new BadRequest(e.getMessage()); throw new BadRequest(e.getMessage());
} }
return ResponseHelper.buildResponse(householdContract); return ResponseHelper.buildResponse(householdContract);
......
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits; import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.DropDown; import com.yeejoin.amos.boot.module.hygf.api.dto.DropDown;
import com.yeejoin.amos.boot.module.hygf.api.entity.Maintenance; import com.yeejoin.amos.boot.module.hygf.api.entity.Maintenance;
...@@ -9,6 +10,7 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper; ...@@ -9,6 +10,7 @@ import com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.MaintenanceMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.MaintenanceMapper;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -22,6 +24,7 @@ import java.util.List; ...@@ -22,6 +24,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.MaintenanceServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.MaintenanceServiceImpl;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -43,6 +46,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -43,6 +46,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
@RestController @RestController
@Api(tags = "运维人员Api") @Api(tags = "运维人员Api")
@RequestMapping(value = "/maintenance") @RequestMapping(value = "/maintenance")
@Slf4j
public class MaintenanceController extends BaseController { public class MaintenanceController extends BaseController {
@Autowired @Autowired
...@@ -62,7 +66,12 @@ public class MaintenanceController extends BaseController { ...@@ -62,7 +66,12 @@ public class MaintenanceController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增运维人员", notes = "新增运维人员") @ApiOperation(httpMethod = "POST", value = "新增运维人员", notes = "新增运维人员")
public ResponseModel<Maintenance> save(@RequestBody Maintenance model) { public ResponseModel<Maintenance> save(@RequestBody Maintenance model) {
try {
model = maintenanceServiceImpl.saveMaintenance(model); model = maintenanceServiceImpl.saveMaintenance(model);
} catch (Exception e) {
log.error("农户注册错误, 入参: {}, error:", JSON.toJSONString(model), e);
throw new BadRequest(e.getMessage());
}
return ResponseHelper.buildResponse(model); return ResponseHelper.buildResponse(model);
} }
......
package com.yeejoin.amos.boot.module.hygf.biz.controller; package com.yeejoin.amos.boot.module.hygf.biz.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits; import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import com.yeejoin.amos.boot.module.hygf.api.dto.PeasantHouseholdDto; import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.dto.PreparationMoneyDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.PreparationPageDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.DesignInformation; import com.yeejoin.amos.boot.module.hygf.api.entity.DesignInformation;
import com.yeejoin.amos.boot.module.hygf.api.entity.HygfReplenishment; import com.yeejoin.amos.boot.module.hygf.api.entity.HygfReplenishment;
import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold; import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
...@@ -24,6 +22,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; ...@@ -24,6 +22,7 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.annotation.GlobalTransactional;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -69,6 +68,7 @@ public class PreparationMoneyController extends BaseController { ...@@ -69,6 +68,7 @@ public class PreparationMoneyController extends BaseController {
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增发货单", notes = "新增发货单") @ApiOperation(httpMethod = "POST", value = "新增发货单", notes = "新增发货单")
@GlobalTransactional @GlobalTransactional
@UserLimits
public ResponseModel<PreparationMoney> save( @RequestParam("isSubmit") String isSubmit, @RequestBody PreparationMoney model) { public ResponseModel<PreparationMoney> save( @RequestParam("isSubmit") String isSubmit, @RequestBody PreparationMoney model) {
AgencyUserModel agencyUserModel= getUserInfo(); AgencyUserModel agencyUserModel= getUserInfo();
model = preparationMoneyServiceImpl.saveOrUpdateObjectNew(model,agencyUserModel, isSubmit); model = preparationMoneyServiceImpl.saveOrUpdateObjectNew(model,agencyUserModel, isSubmit);
...@@ -278,7 +278,9 @@ public class PreparationMoneyController extends BaseController { ...@@ -278,7 +278,9 @@ public class PreparationMoneyController extends BaseController {
@ApiOperation(httpMethod = "POST",value = "补货申请", notes = "补货申请") @ApiOperation(httpMethod = "POST",value = "补货申请", notes = "补货申请")
@GlobalTransactional @GlobalTransactional
public ResponseModel replenishmentSubmit( @RequestBody HygfReplenishment hygfReplenishment) { public ResponseModel replenishmentSubmit( @RequestBody HygfReplenishment hygfReplenishment) {
// HygfReplenishment hygfReplenishment1 = new HygfReplenishment();
// BeanUtils.copyProperties(hygfReplenishment,hygfReplenishment1);
// hygfReplenishment1.setFile(JSON.toJSONString(hygfReplenishment.getFile()));
hygfReplenishmentService.save(hygfReplenishment); hygfReplenishmentService.save(hygfReplenishment);
preparationMoneyServiceImpl.replenishmentSubmit(hygfReplenishment.getPreparationMoneyId()); preparationMoneyServiceImpl.replenishmentSubmit(hygfReplenishment.getPreparationMoneyId());
return CommonResponseNewUtil.success(); return CommonResponseNewUtil.success();
......
...@@ -30,6 +30,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.service.impl.QiyuesuoServiceImpl; ...@@ -30,6 +30,7 @@ import com.yeejoin.amos.boot.module.hygf.biz.service.impl.QiyuesuoServiceImpl;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.ToDoTasksServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.ToDoTasksServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -59,6 +60,7 @@ import java.util.Map; ...@@ -59,6 +60,7 @@ import java.util.Map;
@RestController @RestController
@Api(tags = "契税锁Api") @Api(tags = "契税锁Api")
@RequestMapping(value = "/qiyuesuo") @RequestMapping(value = "/qiyuesuo")
@Slf4j
public class QiyuesuoController extends BaseController { public class QiyuesuoController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(QiyuesuoController.class); private static final Logger logger = LoggerFactory.getLogger(QiyuesuoController.class);
...@@ -139,6 +141,7 @@ public class QiyuesuoController extends BaseController { ...@@ -139,6 +141,7 @@ public class QiyuesuoController extends BaseController {
try { try {
householdContract = householdContractServiceImpl.initiateHouseholdContract(model); householdContract = householdContractServiceImpl.initiateHouseholdContract(model);
} catch (Exception e) { } catch (Exception e) {
log.error("创建合同错误, 入参: {}, error:", JSON.toJSONString(model), e);
throw new BadRequest(e.getMessage()); throw new BadRequest(e.getMessage());
} }
return ResponseHelper.buildResponse(householdContract); return ResponseHelper.buildResponse(householdContract);
......
...@@ -281,7 +281,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina ...@@ -281,7 +281,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
if (null == financingAuditingDto.getInstanceId()) { if (null == financingAuditingDto.getInstanceId()) {
financingAuditingDto.setInstanceId(financingAuditing.getInstanceId()); financingAuditingDto.setInstanceId(financingAuditing.getInstanceId());
} }
financingAuditingDto.setStatus(params.getOrDefault("comments", "").toString()); financingAuditingDto.setStatus(params.get("approvalStatus").toString());
financingAuditingDto.setNodeRouting(FinancingAuditEnum.getNodeByCode(workflowResultDto.getNextNodeKey())); financingAuditingDto.setNodeRouting(FinancingAuditEnum.getNodeByCode(workflowResultDto.getNextNodeKey()));
financingAuditingService.createWithModel(financingAuditingDto); financingAuditingService.createWithModel(financingAuditingDto);
......
...@@ -818,7 +818,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto ...@@ -818,7 +818,7 @@ public class PeasantHouseholdServiceImpl extends BaseService<PeasantHouseholdDto
return true; return true;
} catch (Exception e) { } catch (Exception e) {
throw new BadRequest("删除失败!"); throw new BadRequest("删除失败!" + e.getMessage());
} }
} }
......
...@@ -190,17 +190,16 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -190,17 +190,16 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
List<DocumentStation> li = documentStationMapper.selectList(q); List<DocumentStation> li = documentStationMapper.selectList(q);
preparationMoney.setPeasantHouseholdId(li); preparationMoney.setPeasantHouseholdId(li);
LambdaQueryWrapper<HygfReplenishment> h = new LambdaQueryWrapper<>(); List<HygfReplenishment> hygfReplenishments = new ArrayList<>();
h.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr); List<HygfReplenishmentDto> hygfReplenishmentDtos = hygfReplenishmentMapper.selectData(sequenceNbr);
List<HygfReplenishment> hygfReplenishments = hygfReplenishmentMapper.selectList(h);
List<HygfReplenishmentDto> hygfReplenishmentDtos = new ArrayList<>(); if (CollectionUtil.isNotEmpty(hygfReplenishmentDtos) && !hygfReplenishmentDtos.isEmpty() ){
if (CollectionUtil.isNotEmpty(hygfReplenishments) && !hygfReplenishments.isEmpty() ){
hygfReplenishmentDtos.forEach(e->{
hygfReplenishments.forEach(e->{ HygfReplenishment hygfReplenishment = new HygfReplenishment();
HygfReplenishmentDto hygfReplenishmentDto = new HygfReplenishmentDto(); BeanUtils.copyProperties(e,hygfReplenishment);
BeanUtils.copyProperties(e,hygfReplenishmentDto); hygfReplenishment.setFile(JSON.parseArray(e.getFile()));
hygfReplenishmentDto.setFile(JSON.parseArray(e.getFile())); hygfReplenishments.add(hygfReplenishment);
hygfReplenishmentDtos.add(hygfReplenishmentDto);
}); });
preparationMoney.setFiles(hygfReplenishmentDtos); preparationMoney.setFiles(hygfReplenishmentDtos);
...@@ -228,11 +227,11 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -228,11 +227,11 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
public Map<String, Object> selectOnePreparationMoney(String sequenceNbr) { public Map<String, Object> selectOnePreparationMoney(String sequenceNbr) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
LambdaUpdateWrapper<PreparationMoney> qu = new LambdaUpdateWrapper<>(); LambdaQueryWrapper<PreparationMoney> qu = new LambdaQueryWrapper<>();
qu.eq(PreparationMoney::getSequenceNbr, sequenceNbr); qu.eq(PreparationMoney::getSequenceNbr, sequenceNbr);
PreparationMoney preparationMoney = preparationMoneyMapper.selectOne(qu); PreparationMoney preparationMoney = preparationMoneyMapper.selectOne(qu);
LambdaUpdateWrapper<HygfPreparationMoneyAuditing> audit = new LambdaUpdateWrapper<>(); LambdaQueryWrapper<HygfPreparationMoneyAuditing> audit = new LambdaQueryWrapper<>();
audit.eq(HygfPreparationMoneyAuditing::getPreparationMoneyId,sequenceNbr); audit.eq(HygfPreparationMoneyAuditing::getPreparationMoneyId,sequenceNbr);
List<HygfPreparationMoneyAuditing> hygfPreparationMoneyAuditings = hygfPreparationMoneyAuditingService.getBaseMapper().selectList(audit); List<HygfPreparationMoneyAuditing> hygfPreparationMoneyAuditings = hygfPreparationMoneyAuditingService.getBaseMapper().selectList(audit);
if (CollectionUtil.isNotEmpty(hygfPreparationMoneyAuditings) && hygfPreparationMoneyAuditings.size()>0 ){ if (CollectionUtil.isNotEmpty(hygfPreparationMoneyAuditings) && hygfPreparationMoneyAuditings.size()>0 ){
...@@ -271,7 +270,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -271,7 +270,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
LambdaUpdateWrapper<DocumentStation> q = new LambdaUpdateWrapper<>(); LambdaQueryWrapper<DocumentStation> q = new LambdaQueryWrapper<>();
q.eq(DocumentStation::getPreparationMoneyId, sequenceNbr); q.eq(DocumentStation::getPreparationMoneyId, sequenceNbr);
List<DocumentStation> lih = documentStationMapper.selectList(q); List<DocumentStation> lih = documentStationMapper.selectList(q);
preparationMoney.setPeasantHouseholdId(lih); preparationMoney.setPeasantHouseholdId(lih);
...@@ -321,22 +320,23 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -321,22 +320,23 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
designInformation.setCable(cable); designInformation.setCable(cable);
Map<String, Object> map2 = Bean.BeantoMap(preparationMoney); Map<String, Object> map2 = Bean.BeantoMap(preparationMoney);
LambdaUpdateWrapper<HygfReplenishment> h = new LambdaUpdateWrapper<>();
h.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr);
List<HygfReplenishment> hygfReplenishments = hygfReplenishmentMapper.selectList(h);
List<HygfReplenishmentDto> hygfReplenishmentDtos = new ArrayList<>();
if (CollectionUtil.isNotEmpty(hygfReplenishments) && !hygfReplenishments.isEmpty() ){
hygfReplenishments.forEach(e->{
HygfReplenishmentDto hygfReplenishmentDto = new HygfReplenishmentDto();
BeanUtils.copyProperties(e,hygfReplenishmentDto);
hygfReplenishmentDto.setFile(JSON.parseArray(e.getFile()));
hygfReplenishmentDtos.add(hygfReplenishmentDto);
});
map2.put("files",hygfReplenishmentDtos); List<HygfReplenishment> hygfReplenishments = new ArrayList<>();
List<HygfReplenishmentDto> hygfReplenishmentDtos = hygfReplenishmentMapper.selectData(Long.valueOf(sequenceNbr));
if (CollectionUtil.isNotEmpty(hygfReplenishmentDtos) && !hygfReplenishmentDtos.isEmpty() ) {
hygfReplenishmentDtos.forEach(e -> {
HygfReplenishment hygfReplenishment = new HygfReplenishment();
BeanUtils.copyProperties(e, hygfReplenishment);
hygfReplenishment.setFile(JSON.parseArray(e.getFile()));
hygfReplenishments.add(hygfReplenishment);
});
map2.put("files",hygfReplenishments);
} }
map.put("preparationMoney", map2); map.put("preparationMoney", map2);
map.put("designInformation", designInformation); map.put("designInformation", designInformation);
Map<String, Object> map1 = new HashMap<>(); Map<String, Object> map1 = new HashMap<>();
...@@ -619,15 +619,6 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -619,15 +619,6 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
model.setOddNumbers(code); model.setOddNumbers(code);
// if(model.getDeliveryFile()!=null&&!model.getDeliveryFile().isEmpty() && isSubmit.equals("0")){
//
// model.setDeliveryState(DeliveryStateeEnum.已发货.getCode());
// model.setArrivalState(ArrivalStateeEnum.待收货.getCode());
// model.setDeliveryTime(new Date());
// }else{
// model.setDeliveryState(DeliveryStateeEnum.待提交.getCode());
// model.setArrivalState(DeliveryStateeEnum.待发货.getCode());
// }
//更新电站施工状态 //更新电站施工状态
LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>();
...@@ -720,13 +711,20 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -720,13 +711,20 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
} }
List<DocumentStation> ids = model.getPeasantHouseholdId(); List<DocumentStation> ids = model.getPeasantHouseholdId();
LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up = new LambdaUpdateWrapper<>();
String cState = "暂存发货";
String pState = "暂存发货";
if (isSubmit.equals("0")) { if (isSubmit.equals("0")) {
if (CollUtil.isEmpty(ids) && ids.isEmpty() ){ if (CollUtil.isEmpty(ids) && ids.isEmpty() ){
throw new BadRequest("提交时选择电站不可为空"); throw new BadRequest("提交时选择电站不可为空");
} }
// LambdaUpdateWrapper<PeasantHousehold> up1 = new LambdaUpdateWrapper<>();
//更新电站施工状态 //更新电站施工状态
up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.已发货.getCode()); up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.已发货.getCode());
up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.已发货.getCode()); up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.已发货.getCode());
cState = DeliveryStateeEnum.已发货.getCode();
pState = DeliveryStateeEnum.已发货.getCode();
//提交时 赋值发货时间及订单状态 //提交时 赋值发货时间及订单状态
model.setDeliveryTime(new Date()); model.setDeliveryTime(new Date());
model.setOrderStatus(DeliveryStateeEnum.待确认.getName()); model.setOrderStatus(DeliveryStateeEnum.待确认.getName());
...@@ -753,8 +751,12 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -753,8 +751,12 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
hygfPreparationMoneyAuditingDto.setPreparationMoneyId(model.getSequenceNbr()); hygfPreparationMoneyAuditingDto.setPreparationMoneyId(model.getSequenceNbr());
hygfPreparationMoneyAuditingDto.setPromoter(RequestContext.getExeUserId()); hygfPreparationMoneyAuditingDto.setPromoter(RequestContext.getExeUserId());
hygfPreparationMoneyAuditingService.createWithModel(hygfPreparationMoneyAuditingDto); hygfPreparationMoneyAuditingService.createWithModel(hygfPreparationMoneyAuditingDto);
peasantHouseholdMapper.update(null, up); List<Long> collect = ids.stream().map(DocumentStation::getStationId).collect(Collectors.toList());
// up1.in(BaseEntity::getSequenceNbr,collect);
// peasantHouseholdMapper.update(null, up1);
}else {
up.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.暂存发货.getCode());
up.set(PeasantHousehold::getConstructionState, DeliveryStateeEnum.暂存发货.getCode());
} }
preparationMoneyMapper.updateById(model); preparationMoneyMapper.updateById(model);
...@@ -762,6 +764,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -762,6 +764,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
LambdaQueryWrapper<DocumentStation> query1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DocumentStation> query1 = new LambdaQueryWrapper<>();
query1.eq(DocumentStation::getPreparationMoneyId, model.getSequenceNbr()); query1.eq(DocumentStation::getPreparationMoneyId, model.getSequenceNbr());
List<Long> oldIds = documentStationMapper.selectList(query1).stream().map(DocumentStation::getStationId).collect(Collectors.toList()); List<Long> oldIds = documentStationMapper.selectList(query1).stream().map(DocumentStation::getStationId).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(oldIds)){
LambdaUpdateWrapper<PeasantHousehold> up1 = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up1 = new LambdaUpdateWrapper<>();
up1.in(BaseEntity::getSequenceNbr,oldIds); up1.in(BaseEntity::getSequenceNbr,oldIds);
up1.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.待发货.getCode()); up1.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.待发货.getCode());
...@@ -772,6 +775,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -772,6 +775,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
up3.eq(DocumentStation::getPreparationMoneyId, model.getSequenceNbr()); up3.eq(DocumentStation::getPreparationMoneyId, model.getSequenceNbr());
documentStationMapper.delete(up3); documentStationMapper.delete(up3);
}
//电站信息存储 //电站信息存储
if (CollectionUtil.isNotEmpty(ids) && ids.size()>0){ if (CollectionUtil.isNotEmpty(ids) && ids.size()>0){
...@@ -1119,6 +1123,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -1119,6 +1123,7 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
LambdaQueryWrapper<DocumentStation> query1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<DocumentStation> query1 = new LambdaQueryWrapper<>();
query1.eq(DocumentStation::getPreparationMoneyId, model.getSequenceNbr()); query1.eq(DocumentStation::getPreparationMoneyId, model.getSequenceNbr());
List<Long> oldIds = documentStationMapper.selectList(query1).stream().map(DocumentStation::getStationId).collect(Collectors.toList()); List<Long> oldIds = documentStationMapper.selectList(query1).stream().map(DocumentStation::getStationId).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(oldIds)){
LambdaUpdateWrapper<PeasantHousehold> up1 = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<PeasantHousehold> up1 = new LambdaUpdateWrapper<>();
up1.in(BaseEntity::getSequenceNbr,oldIds); up1.in(BaseEntity::getSequenceNbr,oldIds);
up1.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.待发货.getCode()); up1.set(PeasantHousehold::getPreparationMoneyState, DeliveryStateeEnum.待发货.getCode());
...@@ -1129,6 +1134,10 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -1129,6 +1134,10 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
up3.eq(DocumentStation::getPreparationMoneyId, model.getSequenceNbr()); up3.eq(DocumentStation::getPreparationMoneyId, model.getSequenceNbr());
documentStationMapper.delete(up3); documentStationMapper.delete(up3);
}
//电站信息存储 //电站信息存储
if (CollectionUtil.isNotEmpty(ids) && ids.size()>0){ if (CollectionUtil.isNotEmpty(ids) && ids.size()>0){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment