发货详情开发
This commit is contained in:
parent
90240d3509
commit
73bee619f6
|
|
@ -1,6 +1,62 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AliAccessStaticViaInstance" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AliDeprecation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAbstractClassShouldStartWithAbstractNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidApacheBeanUtilsCopy" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidCallStaticSimpleDateFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidCommentBehindStatement" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidComplexCondition" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidConcurrentCompetitionRandom" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidDoubleOrFloatEqualCompare" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidManuallyCreateThread" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidMissUseOfMathRandom" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidNegationOperator" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidNewDateGetTime" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidPatternCompileInMethod" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidReturnInFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidStartWithDollarAndUnderLineNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaAvoidUseTimer" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaBigDecimalAvoidDoubleConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaBooleanPropertyShouldNotStartWithIs" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassCastExceptionWithSubListToArrayList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassCastExceptionWithToArray" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassMustHaveAuthor" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaClassNamingShouldBeCamel" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaCollectionInitShouldAssignCapacity" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaCommentsMustBeJavadocFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaConcurrentExceptionWithModifyOriginSubList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaConstantFieldShouldBeUpperCase" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaCountDownShouldInFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaDontModifyInForeachCircle" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaEnumConstantsMustHaveComment" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaExceptionClassShouldEndWithException" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaIbatisMethodQueryForList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaLockShouldWithTryFinally" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaLowerCamelCaseVariableNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaMethodReturnWrapperType" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaMethodTooLong" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPackageNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPojoMustOverrideToString" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPojoMustUsePrimitiveField" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaPojoNoDefaultValue" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaRemoveCommentedCode" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaServiceOrDaoClassShouldEndWithImpl" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaSneakyThrowsWithoutExceptionType" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaStringConcat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaSwitchExpression" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaSwitchStatement" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaTestClassShouldEndWithTestNaming" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaThreadLocalShouldRemove" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaThreadPoolCreation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaThreadShouldSetName" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaTransactionMustHaveRollback" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUndefineMagicConstant" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUnsupportedExceptionWithModifyAsList" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUseQuietReferenceNotation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="AlibabaUseRightCaseForDateFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="TOP_LEVEL_CLASS_OPTIONS">
|
||||
<value>
|
||||
|
|
@ -32,5 +88,41 @@
|
|||
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
|
||||
<option name="myAdditionalJavadocTags" value="date" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ADDITIONAL_TAGS" value="date" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="MissingJavadoc" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="PACKAGE_SETTINGS">
|
||||
<Options>
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
<option name="MODULE_SETTINGS">
|
||||
<Options>
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
<option name="TOP_LEVEL_CLASS_SETTINGS">
|
||||
<Options>
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
<option name="INNER_CLASS_SETTINGS">
|
||||
<Options>
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
<option name="METHOD_SETTINGS">
|
||||
<Options>
|
||||
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
<option name="FIELD_SETTINGS">
|
||||
<Options>
|
||||
<option name="ENABLED" value="false" />
|
||||
</Options>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
||||
|
|
@ -67,6 +67,18 @@ public class PlanOutController {
|
|||
PageInfo<ProNeedInfo> pageInfo = service.getPorInfoDetail(dto.getData());;
|
||||
return pageInfo;
|
||||
}
|
||||
/**
|
||||
* X详情接口
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getPorInfoDetail2")
|
||||
@DecryptAndVerify(decryptedClass = ProNeedInfo.class)
|
||||
public PageInfo<ProNeedInfo> getPorInfoDetail2(EncryptedReq<ProNeedInfo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
PageInfo<ProNeedInfo> pageInfo = service.getPorInfoDetail2(dto.getData());;
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -90,9 +102,6 @@ public class PlanOutController {
|
|||
return service.insertProOutPutInfo(request,files);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询批次数量
|
||||
* @return
|
||||
|
|
@ -115,5 +124,19 @@ public class PlanOutController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* X详情接口
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getOutDetailList")
|
||||
@DecryptAndVerify(decryptedClass = ProNeedInfo.class)
|
||||
public PageInfo<ProNeedInfo> getOutDetailList(EncryptedReq<ProNeedInfo> dto) {
|
||||
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
|
||||
PageInfo<ProNeedInfo> pageInfo = service.getOutDetailList(dto.getData());;
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,44 @@ package com.bonus.gzgqj.business.plan.entity;
|
|||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出货详情查询
|
||||
* @author 黑子
|
||||
*/
|
||||
@Data
|
||||
public class OutDetailInfoVo {
|
||||
|
||||
private String userName;
|
||||
private String id;
|
||||
/**
|
||||
* 发货人
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 发货 日期
|
||||
*/
|
||||
private String createDay;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String proId;
|
||||
|
||||
|
||||
/**
|
||||
* 概述
|
||||
*/
|
||||
private String details;
|
||||
/**
|
||||
* 文件上传 集合
|
||||
*/
|
||||
private List<FileUploadVo> fileList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
package com.bonus.gzgqj.business.plan.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 工程需要数据
|
||||
* @author 黑子
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class ProNeedInfo extends PageInfo {
|
||||
/**
|
||||
|
|
@ -87,4 +90,7 @@ public class ProNeedInfo extends PageInfo {
|
|||
private String progress;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,11 @@ package com.bonus.gzgqj.business.plan.mapper;
|
|||
import com.bonus.gzgqj.business.plan.entity.FileUploadVo;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 黑子
|
||||
*/
|
||||
@Repository
|
||||
public interface FileUploadMapper {
|
||||
/**
|
||||
|
|
@ -10,4 +15,11 @@ public interface FileUploadMapper {
|
|||
* @param vo
|
||||
*/
|
||||
void insertFileUpload(FileUploadVo vo);
|
||||
|
||||
/**
|
||||
* 查询数据结合
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
List<FileUploadVo> getFileList(FileUploadVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,13 @@ public interface PlanOutMapper {
|
|||
*/
|
||||
List<ProNeedInfo> getPorInfoDetail(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 分页查询工程 发货详情
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<ProNeedInfo> getPorInfoDetail2(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 下拉选
|
||||
* @param data
|
||||
|
|
@ -99,17 +106,30 @@ public interface PlanOutMapper {
|
|||
*/
|
||||
StatisticsVo getOverNum();
|
||||
|
||||
/**
|
||||
* 查询分页详情
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<ProNeedInfo> getOutDetails(ProNeedInfo data);
|
||||
|
||||
|
||||
/**
|
||||
* 获取 发货批次
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<String> getOutTimes(ProNeedInfo data);
|
||||
List<OutDetailInfoVo> getOutTimes(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 查询详情1
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
OutDetailInfoVo getOutDetails(ProNeedInfo data);
|
||||
|
||||
ProNeedInfo getHisAddData(ProNeedInfo insertObj);
|
||||
|
||||
List<String> getOutDetailsInfo(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 发货批次详情
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
List<ProNeedInfo> getOutDetailList(ProNeedInfo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,4 +59,18 @@ public interface PlanOutService {
|
|||
* @return
|
||||
*/
|
||||
ServerResponse getOutDetails(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 详情接口
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
PageInfo<ProNeedInfo> getPorInfoDetail2(ProNeedInfo data);
|
||||
|
||||
/**
|
||||
* 批次详情查询
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
PageInfo<ProNeedInfo> getOutDetailList(ProNeedInfo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,10 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
|
|
@ -72,6 +74,40 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
PageInfo<ProNeedInfo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
/**
|
||||
* 分页查询 工程 发货详情
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<ProNeedInfo> getPorInfoDetail2(ProNeedInfo data) {
|
||||
List<ProNeedInfo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getPorInfoDetail2(data);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
PageInfo<ProNeedInfo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批次详情查询
|
||||
* @param data
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<ProNeedInfo> getOutDetailList(ProNeedInfo data) {
|
||||
List<ProNeedInfo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getOutDetailList(data);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
PageInfo<ProNeedInfo> pageInfo = new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 拆线呢 工程设备下拉选
|
||||
|
|
@ -132,24 +168,23 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
}
|
||||
if(num>0){
|
||||
//计算 本次全部发货数量及整改数量 最后同步到 工程 -计划-发货统计表中
|
||||
int allFhNum=0;
|
||||
//非计划发货数量
|
||||
int allFhNum2=0;
|
||||
//非计划发货次数
|
||||
int count=0;
|
||||
int allTzNum=0;
|
||||
Map<String,Integer> numMap=new HashMap<>();
|
||||
numMap.put("allFhNum",0);
|
||||
numMap.put("allFhNum2",0);
|
||||
numMap.put("count",0);
|
||||
numMap.put("allTzNum",0);
|
||||
//处理 发货单
|
||||
boolean a= planOutInfo(list,vo,allFhNum,allTzNum);
|
||||
boolean a= planOutInfo(list,vo,numMap);
|
||||
if(!a){
|
||||
return ServerResponse.createErroe("发货失败");
|
||||
}
|
||||
//处理新增发货单
|
||||
boolean b=addOutPlanInfo(addList,vo,allFhNum2,count);
|
||||
boolean b=addOutPlanInfo(addList,vo,numMap);
|
||||
if(!b){
|
||||
return ServerResponse.createErroe("发货失败");
|
||||
}
|
||||
//处理 发货后 统计及 详情数据
|
||||
boolean c= updateProPlan(vo,allFhNum,allTzNum,allFhNum2,count);
|
||||
boolean c= updateProPlan(vo,numMap);
|
||||
if(!c){
|
||||
return ServerResponse.createErroe("发货失败");
|
||||
}
|
||||
|
|
@ -195,7 +230,7 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
*/
|
||||
@Override
|
||||
public ServerResponse getOutTimes(ProNeedInfo data) {
|
||||
List<String> list=new ArrayList<>();
|
||||
List<OutDetailInfoVo> list=new ArrayList<>();
|
||||
try{
|
||||
list=mapper.getOutTimes(data);
|
||||
}catch (Exception e){
|
||||
|
|
@ -210,15 +245,30 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
|
||||
@Override
|
||||
public ServerResponse getOutDetails(ProNeedInfo data) {
|
||||
return null;
|
||||
try{
|
||||
OutDetailInfoVo vo=mapper.getOutDetails(data);
|
||||
List<FileUploadVo> flieList=uploadService.getFileList(data.getId(),"t_plan_out");
|
||||
List<String> msg=mapper.getOutDetailsInfo(data);
|
||||
String result = String.join(",", msg); // 结果为 "apple, banana, orange"
|
||||
vo.setDetails(result);
|
||||
vo.setFileList(flieList);
|
||||
return ServerResponse.createSuccess(vo);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createErroe("接口异常");
|
||||
}
|
||||
|
||||
|
||||
public boolean planOutInfo(List<ProOutDetail> list,ProOutInfoVo vo,int allFhNum, int allTzNum){
|
||||
public boolean planOutInfo(List<ProOutDetail> list,ProOutInfoVo vo, Map<String,Integer> map){
|
||||
try {
|
||||
for (ProOutDetail details:list){
|
||||
int allFhNum=map.get("allFhNum");
|
||||
int allTzNum=map.get("allTzNum");
|
||||
allFhNum=allFhNum+details.getNum();
|
||||
allTzNum=allTzNum+details.getTzNum();
|
||||
map.put("allFhNum",allFhNum);
|
||||
map.put("allTzNum",allTzNum);
|
||||
//获取 计划数据
|
||||
ProNeedInfo data=mapper.getProNeedInfo(details);
|
||||
if(data==null){
|
||||
|
|
@ -227,7 +277,7 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
}else{
|
||||
//需要的数量
|
||||
ProNeedInfo insertObj=new ProNeedInfo();
|
||||
BeanUtils.copyProperties(insertObj,data);
|
||||
BeanUtils.copyProperties(data,insertObj);
|
||||
insertObj.setOutId(vo.getId());
|
||||
insertObj.setDataType("1");
|
||||
insertObj.setFhNum(details.getNum());
|
||||
|
|
@ -243,14 +293,13 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
int tzNum2=details.getTzNum();
|
||||
data.setFhNum(fhNum+fhNum2);
|
||||
data.setTzNum(tzNum+tzNum2);
|
||||
|
||||
mapper.updateNeedInfo(data);
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
|
|
@ -260,19 +309,23 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
|
||||
/**
|
||||
* 更新工程 -统计数据
|
||||
* @param allTzNum 全部调整数量
|
||||
* @param vo
|
||||
* @param allFhNum 全部发货数量
|
||||
* @param allFhNum 超出需求数量
|
||||
* @return
|
||||
* @param map 全部调整数量
|
||||
* @param vo 实体
|
||||
|
||||
*/
|
||||
public Boolean updateProPlan( ProOutInfoVo vo,int allFhNum, int allTzNum ,int allFhNum2,int count ){
|
||||
public Boolean updateProPlan(ProOutInfoVo vo, Map<String,Integer> map ){
|
||||
try {
|
||||
int allFhNum=map.get("allFhNum");
|
||||
int allTzNum=map.get("allTzNum");
|
||||
int count=map.get("count");
|
||||
int allFhNum2=map.get("allFhNum2");
|
||||
//更新工程 总数据信息
|
||||
ProPlanInfoVo data= mapper.getProPlanInfo(vo);
|
||||
int recordNum=data.getRecordNum();
|
||||
int outNum= data.getOutNum();
|
||||
int needNum= data.getNeedNum();
|
||||
int num=data.getRecordNum2();
|
||||
int outNum2=data.getOutNum2();
|
||||
recordNum=recordNum+1;
|
||||
outNum=outNum+allFhNum;
|
||||
data.setRecordNum(recordNum);
|
||||
|
|
@ -288,9 +341,9 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
}
|
||||
data.setLastDay(vo.getCreateDay());
|
||||
//非计划发货数量
|
||||
data.setOutNum2(allFhNum2);
|
||||
data.setOutNum2(allFhNum2+outNum2);
|
||||
//非计划发货次数 .
|
||||
data.setRecordNum2(count);
|
||||
data.setRecordNum2(count+num);
|
||||
//更新 工程-计划 -统计表
|
||||
mapper.updatePriPlanInfo(data);
|
||||
return true;
|
||||
|
|
@ -304,15 +357,18 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
* 传入
|
||||
* 新增集合、发货单、发货数量
|
||||
*/
|
||||
public Boolean addOutPlanInfo(List<ProAddInfoDetails> addList, ProOutInfoVo vo,int allFhNum,int count){
|
||||
public Boolean addOutPlanInfo(List<ProAddInfoDetails> addList, ProOutInfoVo vo, Map<String,Integer> map){
|
||||
try {
|
||||
//是否有 新增
|
||||
if(StringUtils.isNotEmpty(addList)){
|
||||
int count=map.get("count");
|
||||
count=count+1;
|
||||
map.put("count",count);
|
||||
//全部新增发货清单
|
||||
for (ProAddInfoDetails details:addList){
|
||||
|
||||
int allFhNum=map.get("allFhNum2");
|
||||
allFhNum=allFhNum+details.getFhNum();
|
||||
map.put("allFhNum2",allFhNum);
|
||||
ProNeedInfo insertObj=new ProNeedInfo();
|
||||
insertObj.setOutId(vo.getId());
|
||||
insertObj.setDataType("1");
|
||||
|
|
@ -325,18 +381,27 @@ public class PlanOutServiceImpl implements PlanOutService{
|
|||
insertObj.setUnit(details.getUnit());
|
||||
insertObj.setRemarks(details.getRemark());
|
||||
insertObj.setDataType("2");
|
||||
insertObj.setNeedType("2");
|
||||
insertObj.setProId(vo.getProId());
|
||||
//添加 记录清单
|
||||
int num2=mapper.insertProNeedDetails(insertObj);
|
||||
if(num2>=0){
|
||||
//新增 工程-计划-发货 清单表
|
||||
mapper.addNeedInfo(insertObj);
|
||||
return true;
|
||||
ProNeedInfo data=mapper.getHisAddData(insertObj);
|
||||
if (data!=null && data.getId()!=null){
|
||||
insertObj.setFhNum(data.getFhNum()+details.getFhNum());
|
||||
mapper.updateNeedInfo(insertObj);
|
||||
}else {
|
||||
//新增 工程-计划-发货 清单表
|
||||
mapper.addNeedInfo(insertObj);
|
||||
}
|
||||
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ public class FileUploadService {
|
|||
for (MultipartFile file : files) {
|
||||
String fileName = file.getOriginalFilename();
|
||||
String suffix=IDUtils.getSuffix(fileName);
|
||||
String newPath= SystemUtils.getUploadPath()+ DateTimeHelper.getNowYMD()+"/"+ IDUtils.createID()+suffix;
|
||||
String path= DateTimeHelper.getNowYMD()+"/"+ IDUtils.createID()+suffix;
|
||||
String newPath= SystemUtils.getUploadPath()+path;
|
||||
File uploadFile = new File(newPath);
|
||||
//生成文件夹
|
||||
if (!uploadFile.getParentFile().exists()) {
|
||||
|
|
@ -49,7 +50,7 @@ public class FileUploadService {
|
|||
file.transferTo(uploadFile);
|
||||
FileUploadVo vo=new FileUploadVo();
|
||||
vo.setFileName(fileName);
|
||||
vo.setFileUrl(newPath);
|
||||
vo.setFileUrl(path);
|
||||
vo.setOwnId(outId);
|
||||
vo.setModelTable(table);
|
||||
vo.setSuffix(suffix);
|
||||
|
|
@ -68,7 +69,20 @@ public class FileUploadService {
|
|||
}
|
||||
|
||||
|
||||
public List<FileUploadVo> getFileList( String outId, String table){
|
||||
List<FileUploadVo> list=new ArrayList<>();
|
||||
try {
|
||||
FileUploadVo vo=new FileUploadVo();
|
||||
vo.setOwnId(outId);
|
||||
vo.setModelTable(table);
|
||||
list=mapper.getFileList(vo);
|
||||
|
||||
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
|||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
|
@ -17,6 +18,7 @@ public class ServerResponse<T> implements Serializable {
|
|||
|
||||
private String msg;
|
||||
|
||||
@Getter
|
||||
private T data;
|
||||
|
||||
private Long count;
|
||||
|
|
@ -69,17 +71,7 @@ public class ServerResponse<T> implements Serializable {
|
|||
return this.status==ResponseCode.SUCCESS.getCode();
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页返回数据封装
|
||||
|
|
@ -91,8 +83,8 @@ public class ServerResponse<T> implements Serializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param curr
|
||||
* @param limit
|
||||
* @param curr 史
|
||||
* @param limit 长度
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,4 +17,17 @@
|
|||
)values(#{fileName},#{fileUrl},now(),#{creator},#{modelTable},#{ownId},#{suffix},#{fileType})
|
||||
|
||||
</insert>
|
||||
<select id="getFileList" resultType="com.bonus.gzgqj.business.plan.entity.FileUploadVo">
|
||||
select id, file_name fileName,
|
||||
file_url fileUrl,
|
||||
create_time createTime,
|
||||
creator creator,
|
||||
model_table,
|
||||
own_id ownId ,
|
||||
suffix,
|
||||
file_type fileType
|
||||
from bm_file_upload
|
||||
where own_id=#{ownId} and model_table=#{modelTable}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
select
|
||||
ppi.pro_id proId, ppi.need_num needNum,pro.`NAME` proName,tz_num,
|
||||
ppi.plan_num planNum,ppi.record_num recordNum,
|
||||
ppi.out_num outNum, ppi.status,IFNULL((out_num+tz_num)*100/need_num ,0) progress,
|
||||
ppi.out_num outNum, ppi.status, IFNULL(ROUND((ppi.out_num+ppi.tz_num)*100/ppi.need_num,0),0) progress,
|
||||
ppi.last_day lastDay
|
||||
from t_pro_plan_info ppi
|
||||
LEFT JOIN bm_project pro on ppi.pro_id=pro.id
|
||||
|
|
@ -50,12 +50,18 @@
|
|||
</select>
|
||||
<select id="getPorInfoDetail" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
||||
select pni.id,pni.pro_id proId,pni.type,pni.name,pni.module,pni.module_id,pni.need_type needType,
|
||||
IFNULL(pni.unit,'-') unit ,pni.need_num needNum ,pni.fh_num fhNum ,pro.`NAME` proName ,
|
||||
IF(pni.need_num-pni.fh_num >0,pni.need_num-pni.fh_num,0) diff, IFNULL(ROUND((pni.fh_num+pni.tz_num)*100/pni.need_num,0),0) progress,
|
||||
IF(pni.need_type=1,'计划内','计划外') typeName ,pni.tz_num,pni.remarks
|
||||
IFNULL(pni.unit,'-') unit ,IFNULL(pni.need_num,0) needNum ,(pni.fh_num+pni.tz_num )fhNum ,pro.`NAME` proName ,
|
||||
IF(pni.need_num-pni.fh_num-pni.tz_num >0,pni.need_num-pni.fh_num-pni.tz_num,0) diff, IFNULL(ROUND((pni.fh_num+pni.tz_num)*100/pni.need_num,0),0) progress,
|
||||
IF(pni.need_type=1,'计划内','计划外') typeName ,pni.tz_num tzNum,pni.remarks
|
||||
from t_pro_need_info pni
|
||||
LEFT JOIN bm_project pro on pni.pro_id=pro.id
|
||||
<where>
|
||||
<if test="dataType==null || dataType==''">
|
||||
and pni.need_type=1
|
||||
</if>
|
||||
<if test="proId!=null and proId!=''">
|
||||
and pni.`pro_id` like concat('%',#{proId},'%')
|
||||
</if>
|
||||
<if test="module!=null and module!=''">
|
||||
and pni.`module` like concat('%',#{module},'%')
|
||||
</if>
|
||||
|
|
@ -64,6 +70,27 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getPorInfoDetail2" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
||||
select pni.id,pni.pro_id proId,pni.type,pni.name,pni.module,pni.module_id,pni.need_type needType,
|
||||
IFNULL(pni.unit,'-') unit ,IFNULL(pni.need_num,0) needNum ,(pni.fh_num )fhNum ,pro.`NAME` proName ,
|
||||
IF(pni.need_num-pni.fh_num-pni.tz_num >0,pni.need_num-pni.fh_num-pni.tz_num,0) diff, IFNULL(ROUND((pni.fh_num+pni.tz_num)*100/pni.need_num,0),0) progress,
|
||||
IF(pni.need_type=1,'计划内','计划外') typeName ,pni.tz_num tzNum,pni.remarks
|
||||
from t_pro_need_info pni
|
||||
LEFT JOIN bm_project pro on pni.pro_id=pro.id
|
||||
<where>
|
||||
<if test="proId!=null and proId!=''">
|
||||
and pni.`pro_id` like concat('%',#{proId},'%')
|
||||
</if>
|
||||
<if test="module!=null and module!=''">
|
||||
and pni.`module` like concat('%',#{module},'%')
|
||||
</if>
|
||||
<if test="name!=null and name!=''">
|
||||
and pni.`name` like concat('%',#{name},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getProDevSelected" resultType="com.bonus.gzgqj.business.plan.entity.ProDevSelect">
|
||||
select distinct mt.id ,mt.`NAME`,mt.parent_id
|
||||
from mm_type mt
|
||||
|
|
@ -110,14 +137,52 @@
|
|||
left join mm_type mt on pni.module_id=mt.id
|
||||
where pni.need_type=1
|
||||
</select>
|
||||
<select id="getOutDetails" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
||||
|
||||
|
||||
<select id="getOutTimes" resultType="com.bonus.gzgqj.business.plan.entity.OutDetailInfoVo">
|
||||
select id, create_day createDay,create_time
|
||||
from t_plan_out
|
||||
where pro_id=#{proId}
|
||||
order by create_time desc
|
||||
</select>
|
||||
<select id="getOutTimes" resultType="java.lang.String">
|
||||
select create_day
|
||||
|
||||
<select id="getOutDetails" resultType="com.bonus.gzgqj.business.plan.entity.OutDetailInfoVo">
|
||||
select consignor userName,create_day createDay,remarks,pro_id proId
|
||||
from t_plan_out
|
||||
where pro_id=#{proId}
|
||||
where id=#{id}
|
||||
</select>
|
||||
|
||||
<!--查询历史新增的-->
|
||||
<select id="getHisAddData" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
||||
select pni.id,pni.pro_id proId,pni.type,pni.name,pni.module,pni.module_id,pni.need_type needType,
|
||||
IFNULL(pni.unit,'-') unit ,pni.need_num needNum ,pni.fh_num fhNum
|
||||
,pni.tz_num,pni.remarks
|
||||
from t_pro_need_info pni
|
||||
where pni.module_id=#{moduleId} and pni.pro_id=#{proId}
|
||||
</select>
|
||||
<select id="getOutDetailsInfo" resultType="java.lang.String">
|
||||
select CONCAT(name,":",SUM(fh_num)) detail
|
||||
from t_plan_out_detail
|
||||
where out_id=#{id}
|
||||
GROUP BY name
|
||||
</select>
|
||||
<!--批次详情接口-->
|
||||
<select id="getOutDetailList" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
|
||||
select id,out_id id ,
|
||||
type, name,
|
||||
module, unit,
|
||||
module_id moduleId, fh_num fhNum,
|
||||
tz_num tzNum, remarks,
|
||||
data_type dataType
|
||||
from t_plan_out_detail pod
|
||||
|
||||
<where>
|
||||
out_id=#{id}
|
||||
<if test="module!=null and module!=''">
|
||||
and pod.`module` like concat('%',#{module},'%')
|
||||
</if>
|
||||
<if test="name!=null and name!=''">
|
||||
and pod.`name` like concat('%',#{name},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue