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