Merge remote-tracking branch 'origin/dev-cq' into dev-cq
This commit is contained in:
commit
22529abd22
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
|
|
@ -9,33 +9,20 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 退料
|
||||
* @author hay
|
||||
* @date 2023/12/20 11:56
|
||||
*/
|
||||
* 退料
|
||||
* @author bns_han
|
||||
*/
|
||||
@Data
|
||||
public class BackApplyInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 退料ID */
|
||||
/**
|
||||
* 退料id
|
||||
*/
|
||||
@ApiModelProperty(value = "退料ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value="工程id")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 任务ID
|
||||
*/
|
||||
private Integer parentId;
|
||||
private String badId;
|
||||
private String[] split;
|
||||
|
||||
private List<MachinePart> maTypeDetails;
|
||||
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@ApiModelProperty(value="工程名称")
|
||||
private String proName;
|
||||
|
||||
|
|
@ -49,58 +36,21 @@ public class BackApplyInfo extends BaseEntity {
|
|||
*/
|
||||
@ApiModelProperty(value = "装备管理方式名称")
|
||||
private String manageTypeName;
|
||||
|
||||
/**
|
||||
* 机具管理方式
|
||||
*/
|
||||
private String manageType;
|
||||
|
||||
private int flag;
|
||||
|
||||
private BackApplyInfo[] arr;
|
||||
|
||||
private Integer maId;
|
||||
|
||||
/**
|
||||
* 退料状态
|
||||
*/
|
||||
private String backStatus;
|
||||
|
||||
/**
|
||||
* 退料数量
|
||||
*/
|
||||
private Integer backNum;
|
||||
|
||||
private Integer directNum;
|
||||
|
||||
/** 退料单号 */
|
||||
@Excel(name = "退料单号")
|
||||
@ApiModelProperty(value = "退料单号")
|
||||
private String code;
|
||||
|
||||
@Excel(name = "退料单位名称")
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "退料工程名称")
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
private String lotName;
|
||||
|
||||
@Excel(name = "退料工机具类型")
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
|
||||
@Excel(name = "规格型号")
|
||||
@ApiModelProperty(value = "规格编号")
|
||||
private String typeCode;
|
||||
|
||||
/** 退料人员 */
|
||||
@Excel(name = "退料人员")
|
||||
@ApiModelProperty(value = "退料人员")
|
||||
private String backPerson;
|
||||
|
||||
/** 联系电话 */
|
||||
@Excel(name = "退料人联系电话")
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
|
||||
|
||||
|
||||
|
||||
/** 任务ID */
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
|
|
@ -118,22 +68,158 @@ public class BackApplyInfo extends BaseEntity {
|
|||
@ApiModelProperty(value = "签订日期")
|
||||
private String signTime;
|
||||
|
||||
@Excel(name = "退料申请时间")
|
||||
|
||||
/**
|
||||
* 退料人
|
||||
*/
|
||||
private String userName;
|
||||
private String badId;
|
||||
private String[] split;
|
||||
private String[] typeIds;
|
||||
|
||||
@Excel(name = "退料状态",sort = 9)
|
||||
private String taskName;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Excel(name = "联系电话",sort = 6)
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String phone;
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@Excel(name = "退料工程",sort = 3)
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
private String lotName;
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@Excel(name = "退料单位",sort = 2)
|
||||
@ApiModelProperty(value = "单位名称")
|
||||
private String unitName;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String planStartTime;
|
||||
|
||||
|
||||
private String modelId;
|
||||
|
||||
private List<MachinePart> maTypeDetails;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@Excel(name = "退料机具",sort = 4)
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private String typeName;
|
||||
/**
|
||||
* 协议号
|
||||
*/
|
||||
@Excel(name = "协议号",sort = 8)
|
||||
@ApiModelProperty(value = "协议编号")
|
||||
private String agreementCode;
|
||||
/**
|
||||
* 规格编号
|
||||
*/
|
||||
@Excel(name = "规格型号")
|
||||
@ApiModelProperty(value = "规格编号")
|
||||
private String typeCode;
|
||||
|
||||
|
||||
|
||||
|
||||
@Excel(name = "退料单号",sort = 1)
|
||||
@ApiModelProperty(value = "退料单号")
|
||||
private String code;
|
||||
|
||||
@Excel(name = "退料人员",sort = 5)
|
||||
@ApiModelProperty(value = "退料人员")
|
||||
private String backPerson;
|
||||
|
||||
|
||||
@Excel(name = "申请时间",sort = 7)
|
||||
@ApiModelProperty(value = "退料日期")
|
||||
private String backTime;
|
||||
|
||||
@Excel(name = "协议号")
|
||||
@ApiModelProperty(value = "协议编号")
|
||||
private String agreementCode;
|
||||
|
||||
private String type;
|
||||
/**
|
||||
* 合格数量
|
||||
*/
|
||||
private Integer passNum;
|
||||
/**
|
||||
* 维修数量
|
||||
*/
|
||||
private Integer maintenanceNum;
|
||||
/**
|
||||
* 报废数量
|
||||
*/
|
||||
private Integer scrapNum;
|
||||
|
||||
/**
|
||||
* 退料数量
|
||||
*/
|
||||
private Integer backNum;
|
||||
|
||||
/**
|
||||
* 退料状态
|
||||
*/
|
||||
private String backStatus;
|
||||
|
||||
/**
|
||||
* 合格入库数量
|
||||
*/
|
||||
private String inputNum;
|
||||
|
||||
|
||||
|
||||
|
||||
private BackApplyInfo info;
|
||||
|
||||
|
||||
private Integer parentId;
|
||||
private String sdStatus;
|
||||
private String sdId;
|
||||
/**
|
||||
* 二维码编码
|
||||
*/
|
||||
private String qrCode;
|
||||
/**
|
||||
* rfid编码
|
||||
*/
|
||||
private String rfidCode;
|
||||
private String repairedNum;
|
||||
private String backId;
|
||||
private String repairer;
|
||||
|
||||
|
||||
private Integer flag;
|
||||
private Integer partNum;
|
||||
/**
|
||||
* 合格数量
|
||||
*/
|
||||
private Integer hgNum;
|
||||
/**
|
||||
* 维修数量
|
||||
*/
|
||||
private Integer wxNum;
|
||||
/**
|
||||
* 报废数量
|
||||
*/
|
||||
private Integer bfNum;
|
||||
|
||||
|
||||
|
||||
@Excel(name = "退料状态" , readConverterExp = "37=待退料审核,38=退料已审核,39=退料核查中,40=退料完成,101 = 退料审核驳回")
|
||||
@ApiModelProperty(value = "任务状态")
|
||||
private String taskStatus;
|
||||
|
||||
|
||||
/** 机具公司审核人 */
|
||||
@ApiModelProperty(value = "机具公司审核人")
|
||||
private Integer directAuditBy;
|
||||
|
||||
|
||||
/** 机具公司审批时间 */
|
||||
@ApiModelProperty(value = "机具公司审批时间")
|
||||
private String directAuditTime;
|
||||
|
|
@ -174,6 +260,12 @@ public class BackApplyInfo extends BaseEntity {
|
|||
private Integer lotId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "单位id")
|
||||
private Integer unitId;
|
||||
@ApiModelProperty(value = "计量单位")
|
||||
|
|
@ -193,9 +285,11 @@ public class BackApplyInfo extends BaseEntity {
|
|||
private String detailsIdByNum;
|
||||
|
||||
@ApiModelProperty(value = "类型id和数量")
|
||||
|
||||
private String typeIdByNum;
|
||||
|
||||
@ApiModelProperty(value = "详情id")
|
||||
|
||||
private String detailsId;
|
||||
|
||||
@ApiModelProperty(value = "编码")
|
||||
|
|
@ -238,10 +332,15 @@ public class BackApplyInfo extends BaseEntity {
|
|||
@ApiModelProperty(value="退料任务实体集合")
|
||||
private List<BackApplyInfo> backApplyDetails;
|
||||
|
||||
/**审核状态*/
|
||||
@ApiModelProperty(value="同一退料单中不同器具状态")
|
||||
private String status;
|
||||
|
||||
private String guigeCn;
|
||||
|
||||
/**
|
||||
* 退料数量
|
||||
*/
|
||||
private String preNum;
|
||||
private String auditNum;
|
||||
private String typeCn;
|
||||
|
|
@ -252,4 +351,6 @@ public class BackApplyInfo extends BaseEntity {
|
|||
|
||||
private int viewWeb;
|
||||
|
||||
/** 操作后库存 */
|
||||
private int postStoreNum;
|
||||
}
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* @author syruan
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class BmStorageLog extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Excel(name = "ID")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 模块名称/title标题
|
||||
*/
|
||||
@Excel(name = "模块名称/title标题")
|
||||
private String modelTitle;
|
||||
|
||||
/**
|
||||
* 接口地址/请求方法
|
||||
*/
|
||||
@Excel(name = "接口地址/请求方法")
|
||||
private String method;
|
||||
|
||||
/** 请求方式 */
|
||||
@Excel(name = "请求方式")
|
||||
private String requestMethod;
|
||||
|
||||
/**
|
||||
* 实例
|
||||
*/
|
||||
@Excel(name = "实例/任务")
|
||||
private String taskId;
|
||||
|
||||
@Excel(name = "协议id")
|
||||
private int agreementId;
|
||||
|
||||
/**
|
||||
* 任务名称
|
||||
*/
|
||||
private String taskName;
|
||||
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
@Excel(name = "规格id")
|
||||
private Integer typeId;
|
||||
|
||||
/**
|
||||
* 规格名称
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 父级规格名称
|
||||
*/
|
||||
private String typeParentName;
|
||||
|
||||
|
||||
@Excel(name = "操作前库存")
|
||||
private int preStoreNum;
|
||||
|
||||
@Excel(name = "入库数量")
|
||||
private int inNum;
|
||||
|
||||
@Excel(name = "出库数量")
|
||||
private int outNum;
|
||||
|
||||
@Excel(name = "退库数量")
|
||||
private int backNum;
|
||||
|
||||
@Excel(name = "合格数量")
|
||||
private int passNum;
|
||||
|
||||
@Excel(name = "维修数量")
|
||||
private int maintenanceNum;
|
||||
|
||||
@Excel(name = "报废数量")
|
||||
private int scrapNum;
|
||||
|
||||
@Excel(name = "操作后库存")
|
||||
private int postStoreNum;
|
||||
|
||||
@Excel(name = "出库类型 0编码出库 1数量出库 2成套出库")
|
||||
private String manageType;
|
||||
|
||||
/**
|
||||
* 响应内容/状态码/返回参数
|
||||
*/
|
||||
@Excel(name = "响应内容/状态码/返回参数")
|
||||
private int resultCode;
|
||||
|
||||
/**
|
||||
* 响应内容/状态码/返回参数
|
||||
*/
|
||||
@Excel(name = "响应内容/状态码/返回参数")
|
||||
private String resultMsg;
|
||||
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Excel(name = "创建人")
|
||||
private String creator;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@Excel(name = "型号")
|
||||
private String typeModelName;
|
||||
|
||||
@Excel(name = "状态")
|
||||
private int status;
|
||||
|
||||
@Excel(name = "返回结果")
|
||||
private String jsonResult;
|
||||
|
||||
// private String createBy;
|
||||
// private String parentId;
|
||||
// private String inputNum;
|
||||
//
|
||||
// @Excel(name = "http返回消息")
|
||||
// private String msg;
|
||||
//
|
||||
// @Excel(name = "http返回码")
|
||||
// private String code;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HttpResult {
|
||||
private int code;
|
||||
private int data;
|
||||
private String msg;
|
||||
}
|
||||
|
|
@ -160,4 +160,9 @@ public class LeaseOutDetails implements Serializable {
|
|||
@ApiModelProperty(value = "0工程1长期")
|
||||
private String leaseType;
|
||||
|
||||
@ApiModelProperty(value = "数量出库 -> 操作前库存量")
|
||||
private Integer num;
|
||||
|
||||
/** 操作后库存 */
|
||||
private int postStoreNum;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
|
@ -39,6 +39,12 @@ public class MaInputRecord extends BaseEntity
|
|||
@ApiModelProperty(value = "入库类型(1新购入库,2退料入库,3修试后入库)")
|
||||
private String inputType;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@ApiModelProperty(value = "库存数量")
|
||||
private Double num;
|
||||
|
||||
/** 入库数量 */
|
||||
@ApiModelProperty(value = "入库数量")
|
||||
private BigDecimal inputNum;
|
||||
|
|
@ -104,7 +110,16 @@ public class MaInputRecord extends BaseEntity
|
|||
{
|
||||
return inputType;
|
||||
}
|
||||
public void setInputNum(BigDecimal inputNum)
|
||||
|
||||
public Double getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Double num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public void setInputNum(BigDecimal inputNum)
|
||||
{
|
||||
this.inputNum = inputNum;
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bonus.sgzb.material.vo;
|
||||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import com.bonus.sgzb.material.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputRecord;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.bonus.sgzb.app.domain;
|
||||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.MachIneDto;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
@ -184,6 +184,9 @@ public class SltAgreementInfo {
|
|||
private String partModelName;
|
||||
private String partName;
|
||||
private Integer codeNum;
|
||||
private Integer unitId;
|
||||
private Integer lotId;
|
||||
private Integer leaseType;
|
||||
private List<SltAgreementInfo> node;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.system.api;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.BmStorageLog;
|
||||
import com.bonus.sgzb.system.api.domain.BmNumLogs;
|
||||
import com.bonus.sgzb.system.api.domain.SysOperLog;
|
||||
import com.bonus.sgzb.system.api.factory.RemoteLogFallbackFactory;
|
||||
|
|
@ -12,6 +13,8 @@ import com.bonus.sgzb.common.core.constant.ServiceNameConstants;
|
|||
import com.bonus.sgzb.common.core.domain.R;
|
||||
import com.bonus.sgzb.system.api.domain.SysLogininfor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日志服务
|
||||
*
|
||||
|
|
@ -41,6 +44,17 @@ public interface RemoteLogService
|
|||
public R<Boolean> saveNumberLog(@RequestBody BmNumLogs bmNumLogs, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 保存物资记录日志
|
||||
* @param bmStorageLogList 物资信息
|
||||
* @param source 请求来源
|
||||
* @return 结果
|
||||
* @throws Exception 异常信息
|
||||
*/
|
||||
@PostMapping("/bm_storage_logs")
|
||||
public R<Boolean> batchInsert(@RequestBody List<BmStorageLog> bmStorageLogList, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* 保存访问记录
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.system.api.factory;
|
||||
|
||||
import com.bonus.sgzb.system.api.domain.BmNumLogs;
|
||||
import com.bonus.sgzb.base.api.domain.BmStorageLog;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
|
|
@ -10,6 +11,8 @@ import com.bonus.sgzb.system.api.RemoteLogService;
|
|||
import com.bonus.sgzb.system.api.domain.SysLogininfor;
|
||||
import com.bonus.sgzb.system.api.domain.SysOperLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 日志服务降级处理
|
||||
*
|
||||
|
|
@ -37,6 +40,11 @@ public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogServic
|
|||
return R.fail("保存物资库存日志失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Boolean> batchInsert(List<BmStorageLog> bmStorageLogList, String source) throws Exception {
|
||||
return R.fail("保存物资库存日志失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<Boolean> saveLogininfor(SysLogininfor sysLogininfor, String source)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ public class DateTimeHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取当前时间的年月
|
||||
* 获取上月的年月
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -215,7 +215,7 @@ public class DateTimeHelper {
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取当前时间的上个年月
|
||||
* 获取当前时间的年月
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -223,6 +223,15 @@ public class DateTimeHelper {
|
|||
return format(new Date(), "yyyy-MM");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定时间的年月
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static String getNowMonth(Date date) {
|
||||
return format(date, "yyyy-MM");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前时间的年月日
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,17 +1,22 @@
|
|||
package com.bonus.sgzb.common.log.aspect;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.*;
|
||||
import com.bonus.sgzb.common.core.constant.SecurityConstants;
|
||||
import com.bonus.sgzb.common.core.domain.R;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.log.filter.PropertyPreExcludeFilter;
|
||||
import com.bonus.sgzb.common.log.service.AsyncLogService;
|
||||
import com.bonus.sgzb.system.api.RemoteUserService;
|
||||
import com.bonus.sgzb.system.api.domain.BmNumLogs;
|
||||
import com.bonus.sgzb.system.api.model.LoginUser;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.AfterThrowing;
|
||||
|
|
@ -50,9 +55,14 @@ public class LogAspect
|
|||
/** 计算操作消耗时间 */
|
||||
private static final ThreadLocal<Long> TIME_THREADLOCAL = new NamedThreadLocal<Long>("Cost Time");
|
||||
|
||||
private static ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
@Autowired
|
||||
private AsyncLogService asyncLogService;
|
||||
|
||||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
/**
|
||||
* 处理请求前执行
|
||||
*/
|
||||
|
|
@ -139,32 +149,47 @@ public class LogAspect
|
|||
protected void handleMaterialLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) {
|
||||
try
|
||||
{
|
||||
// *========数据库物资日志=========*//
|
||||
BmNumLogs bmNumLogs = new BmNumLogs();
|
||||
bmNumLogs.setStatus(BusinessStatus.SUCCESS.ordinal());
|
||||
List<BmStorageLog> bmStorageLogList = new ArrayList<>();
|
||||
|
||||
// 请求的地址
|
||||
bmNumLogs.setMethod(StringUtils.substring(Objects.requireNonNull(ServletUtils.getRequest()).getRequestURI(), 0, 255));
|
||||
String username = SecurityUtils.getUsername();
|
||||
if (StringUtils.isNotBlank(username))
|
||||
{
|
||||
bmNumLogs.setCreator(username);
|
||||
}
|
||||
|
||||
if (e != null) {
|
||||
bmNumLogs.setStatus(BusinessStatus.FAIL.ordinal());
|
||||
bmNumLogs.setJsonResult(StringUtils.substring(e.getMessage(), 0, 2000));
|
||||
}
|
||||
// 设置方法名称
|
||||
String className = joinPoint.getTarget().getClass().getName();
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
bmNumLogs.setModelTitle(className + "." + methodName + "()");
|
||||
// 设置请求方式
|
||||
bmNumLogs.setRequestMethod(ServletUtils.getRequest().getMethod());
|
||||
// 处理设置注解上的参数
|
||||
getControllerMethodDescriptionByMaterial(joinPoint, controllerLog, bmNumLogs, jsonResult);
|
||||
setRequestValue(joinPoint, bmStorageLogList);
|
||||
|
||||
for (BmStorageLog bmStorageLog : bmStorageLogList) {
|
||||
bmStorageLog.setStatus(BusinessStatus.SUCCESS.ordinal());
|
||||
|
||||
// 请求的地址
|
||||
bmStorageLog.setMethod(StringUtils.substring(Objects.requireNonNull(ServletUtils.getRequest()).getRequestURI(), 0, 255));
|
||||
String username = SecurityUtils.getUsername();
|
||||
R<LoginUser> userInfo = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
|
||||
if (ObjectUtils.isNotEmpty(userInfo))
|
||||
{
|
||||
bmStorageLog.setCreator(userInfo.getData().getSysUser().getNickName());
|
||||
}
|
||||
|
||||
if (e != null) {
|
||||
bmStorageLog.setStatus(BusinessStatus.FAIL.ordinal());
|
||||
bmStorageLog.setJsonResult(StringUtils.substring(e.getMessage(), 0, 2000));
|
||||
}
|
||||
// 设置方法名称
|
||||
String className = joinPoint.getTarget().getClass().getName();
|
||||
String methodName = joinPoint.getSignature().getName();
|
||||
bmStorageLog.setModelTitle(className + "." + methodName + "()");
|
||||
// 设置请求方式
|
||||
bmStorageLog.setRequestMethod(ServletUtils.getRequest().getMethod());
|
||||
|
||||
bmStorageLog.setModelTitle(controllerLog.title());
|
||||
|
||||
if (StringUtils.isNotNull(jsonResult)) {
|
||||
bmStorageLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
|
||||
HttpResult msgCode = objectMapper.readValue(bmStorageLog.getJsonResult(), HttpResult.class);
|
||||
bmStorageLog.setResultCode(msgCode.getCode());
|
||||
bmStorageLog.setStatus(msgCode.getCode()==200 ? 0 : 1);
|
||||
bmStorageLog.setResultMsg(msgCode.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
// 保存数据库
|
||||
asyncLogService.saveNumLog(bmNumLogs);
|
||||
asyncLogService.batchInsert(bmStorageLogList);
|
||||
}
|
||||
catch (Exception exp)
|
||||
{
|
||||
|
|
@ -206,6 +231,113 @@ public class LogAspect
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取请求的参数,放到log中
|
||||
*
|
||||
* @param bmStorageLogList 物资日志
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
private void setRequestValue(JoinPoint joinPoint, List<BmStorageLog> bmStorageLogList) throws Exception {
|
||||
String requestMethod = ServletUtils.getRequest().getMethod();
|
||||
Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
|
||||
if (StringUtils.isEmpty(paramsMap) && (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))) {
|
||||
// 盘点入库操作
|
||||
if (joinPoint.getArgs()[0] instanceof SavePutInfoDto) {
|
||||
SavePutInfoDto savePutInfoDto = (SavePutInfoDto) joinPoint.getArgs()[0];
|
||||
for (MachIneDto machineDto : savePutInfoDto.getMachIneDtoList()) {
|
||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setTypeId(Integer.parseInt(machineDto.getTypeId()));
|
||||
bmStorageLog.setTypeName(machineDto.getMaCode());
|
||||
bmStorageLog.setPreStoreNum(Objects.isNull(machineDto.getNum()) ? 0 : machineDto.getNum().intValue());
|
||||
bmStorageLog.setInNum(Objects.isNull(machineDto.getPutInStoreNum()) ? 0 : machineDto.getPutInStoreNum().intValue());
|
||||
bmStorageLog.setPostStoreNum(bmStorageLog.getPreStoreNum() + bmStorageLog.getInNum());
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
}
|
||||
// 新购验收任务 PurchaseMacodeInfoController.modifyManageStatus
|
||||
if (joinPoint.getArgs()[0] instanceof MaInputVO) {
|
||||
MaInputVO maInputVO = (MaInputVO) joinPoint.getArgs()[0];
|
||||
for (MaInputRecord maInputRecord : maInputVO.getInputRecordList()) {
|
||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setTypeId(Objects.isNull(maInputRecord.getTypeId()) ? 0 : maInputRecord.getTypeId().intValue());
|
||||
bmStorageLog.setTypeName(maInputRecord.getMaCode());
|
||||
bmStorageLog.setPreStoreNum(Objects.isNull(maInputRecord.getNum()) ? 0: maInputRecord.getNum().intValue());
|
||||
bmStorageLog.setInNum(Objects.isNull(maInputRecord.getInputNum()) ? 0: maInputRecord.getInputNum().intValue());
|
||||
bmStorageLog.setPostStoreNum(bmStorageLog.getPreStoreNum() + bmStorageLog.getInNum());
|
||||
bmStorageLog.setTaskId(String.valueOf(maInputRecord.getTaskId()));
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
}
|
||||
// 新购配件入库审核 PurchaseAccessoryController.checkInput, 因为没有出入库闭环,暂时不加库存监控日志
|
||||
// if (joinPoint.getArgs()[0] instanceof MaInputVO) {
|
||||
// MaInputVO maInputVO = (MaInputVO) joinPoint.getArgs()[0];
|
||||
// for (MaInputRecord maInputRecord : maInputVO.getInputRecordList()) {
|
||||
// BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
// bmStorageLog.setTypeId(Objects.isNull(maInputRecord.getTypeId()) ? 0 : maInputRecord.getTypeId().intValue());
|
||||
// bmStorageLog.setTypeName(maInputRecord.getMaCode());
|
||||
// bmStorageLog.setPreStoreNum(Objects.isNull(maInputRecord.getNum()) ? 0: maInputRecord.getNum().intValue());
|
||||
// bmStorageLog.setInNum(Objects.isNull(maInputRecord.getInputNum()) ? 0: maInputRecord.getInputNum().intValue());
|
||||
// bmStorageLog.setPostStoreNum(bmStorageLog.getPreStoreNum() + bmStorageLog.getInNum());
|
||||
// bmStorageLog.setTaskId(String.valueOf(maInputRecord.getTaskId()));
|
||||
// bmStorageLogList.add(bmStorageLog);
|
||||
// }
|
||||
// }
|
||||
// 领料出库
|
||||
if (joinPoint.getArgs()[0] instanceof List &&
|
||||
((List) joinPoint.getArgs()[0]).stream().noneMatch((o -> !(o instanceof LeaseOutDetails)))) {
|
||||
List<LeaseOutDetails> leaseOutDetails = (List<LeaseOutDetails>)joinPoint.getArgs()[0];
|
||||
for (LeaseOutDetails lod : leaseOutDetails) {
|
||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setTaskId(String.valueOf(lod.getTaskId()));
|
||||
bmStorageLog.setTypeId(lod.getTypeId());
|
||||
bmStorageLog.setTypeName(lod.getMaCode());
|
||||
bmStorageLog.setPreStoreNum(lod.getNum());
|
||||
bmStorageLog.setOutNum(Objects.isNull(lod.getInputNum()) ? 0 : lod.getInputNum().intValue());
|
||||
bmStorageLog.setPostStoreNum(lod.getPostStoreNum());
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
}
|
||||
if (joinPoint.getArgs()[0] instanceof LeaseOutDetails) {
|
||||
LeaseOutDetails lod = (LeaseOutDetails)joinPoint.getArgs()[0];
|
||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setTaskId(String.valueOf(lod.getTaskId()));
|
||||
bmStorageLog.setTypeId(lod.getTypeId());
|
||||
bmStorageLog.setTypeName(lod.getMaCode());
|
||||
bmStorageLog.setPreStoreNum(lod.getNum());
|
||||
bmStorageLog.setOutNum(Objects.isNull(lod.getInputNum()) ? 0 : lod.getInputNum().intValue());
|
||||
bmStorageLog.setPostStoreNum(lod.getPostStoreNum());
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
// 退料接收-完成退料
|
||||
if (joinPoint.getArgs()[0] instanceof BackApplyInfo) {
|
||||
BackApplyInfo bai = (BackApplyInfo)joinPoint.getArgs()[0];
|
||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setTaskId(String.valueOf(bai.getTaskId()));
|
||||
bmStorageLog.setTypeId(Integer.parseInt(bai.getTypeId()));
|
||||
bmStorageLog.setTypeName(bai.getMaCode());
|
||||
bmStorageLog.setPreStoreNum(Integer.parseInt(bai.getNum()));
|
||||
bmStorageLog.setBackNum(bai.getBackNum());
|
||||
bmStorageLog.setPassNum(bai.getPassNum());
|
||||
bmStorageLog.setMaintenanceNum(bai.getMaintenanceNum());
|
||||
bmStorageLog.setScrapNum(bai.getScrapNum());
|
||||
bmStorageLog.setPostStoreNum(bai.getPostStoreNum());
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
// 二级库出入库, 不影响ma_type库存变化,暂时不加库存监控日志
|
||||
// if (joinPoint.getArgs()[0] instanceof TeamLeaseInfo) {
|
||||
// TeamLeaseInfo tli = (TeamLeaseInfo)joinPoint.getArgs()[0];
|
||||
// BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
// bmStorageLog.setAgreementId(Integer.parseInt(tli.getAgreementId()));
|
||||
// bmStorageLog.setTypeId(Integer.parseInt(tli.getTypeId()));
|
||||
// bmStorageLog.setTypeName(tli.getTypeName());
|
||||
// bmStorageLog.setPreStoreNum(1);
|
||||
// bmStorageLog.setPreStoreNum(Integer.parseInt(tli.getNum())); //出入库数量,type=1出库,type=2退库
|
||||
// bmStorageLog.setPostStoreNum(1);
|
||||
// bmStorageLogList.add(bmStorageLog);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取注解中对方法的描述信息 用于Controller层注解
|
||||
*
|
||||
|
|
@ -213,17 +345,17 @@ public class LogAspect
|
|||
* @param materialLog 物资日志
|
||||
* @throws Exception
|
||||
*/
|
||||
public void getControllerMethodDescriptionByMaterial(JoinPoint joinPoint, Log log, BmNumLogs materialLog, Object jsonResult) throws Exception
|
||||
{
|
||||
// 设置标题
|
||||
materialLog.setModelTitle(log.title());
|
||||
// 获取参数的信息,传入到数据库中。
|
||||
setRequestValue(joinPoint, materialLog, log.excludeParamNames());
|
||||
// 保存response,参数和值
|
||||
if (StringUtils.isNotNull(jsonResult)) {
|
||||
materialLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
|
||||
}
|
||||
}
|
||||
// public void getControllerMethodDescriptionByMaterial(JoinPoint joinPoint, Log log, BmNumLogs materialLog, Object jsonResult) throws Exception
|
||||
// {
|
||||
// // 设置标题
|
||||
// materialLog.setModelTitle(log.title());
|
||||
// // 获取参数的信息,传入到数据库中。
|
||||
// setRequestValue(joinPoint, materialLog, log.excludeParamNames());
|
||||
// // 保存response,参数和值
|
||||
// if (StringUtils.isNotNull(jsonResult)) {
|
||||
// materialLog.setJsonResult(StringUtils.substring(JSON.toJSONString(jsonResult), 0, 2000));
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取请求的参数,放到log中
|
||||
|
|
@ -250,35 +382,35 @@ public class LogAspect
|
|||
* @param numLog 物资日志
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
private void setRequestValue(JoinPoint joinPoint, BmNumLogs numLog, String[] excludeParamNames) throws Exception {
|
||||
String requestMethod = numLog.getRequestMethod();
|
||||
Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
|
||||
if (StringUtils.isEmpty(paramsMap)) {
|
||||
if ((HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))){
|
||||
String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
|
||||
numLog.setDescription(StringUtils.substring(params, 0, 2000));
|
||||
}
|
||||
} else {
|
||||
if (paramsMap.containsKey("num")) {
|
||||
if (paramsMap.get("num") instanceof Integer) {
|
||||
numLog.setNum(String.valueOf(paramsMap.get("num")));
|
||||
} else if (paramsMap.get("num") instanceof String) {
|
||||
numLog.setNum((String) paramsMap.get("num"));
|
||||
}
|
||||
}
|
||||
if (paramsMap.containsKey("taskId")) {
|
||||
numLog.setTask(String.valueOf(paramsMap.get("taskId")));
|
||||
}
|
||||
if (paramsMap.containsKey("typeId")) {
|
||||
if (paramsMap.get("typeId") instanceof Integer) {
|
||||
numLog.setTypeId((Integer) paramsMap.get("typeId"));
|
||||
} else if (paramsMap.get("typeId") instanceof String) {
|
||||
numLog.setTypeId(Integer.valueOf((String) paramsMap.get("typeId")));
|
||||
}
|
||||
}
|
||||
numLog.setDescription(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter(excludeParamNames)), 0, 2000));
|
||||
}
|
||||
}
|
||||
// private void setRequestValue(JoinPoint joinPoint, BmNumLogs numLog, String[] excludeParamNames) throws Exception {
|
||||
// String requestMethod = numLog.getRequestMethod();
|
||||
// Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
|
||||
// if (StringUtils.isEmpty(paramsMap)) {
|
||||
// if ((HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))){
|
||||
// String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
|
||||
// numLog.setDescription(StringUtils.substring(params, 0, 2000));
|
||||
// }
|
||||
// } else {
|
||||
// if (paramsMap.containsKey("num")) {
|
||||
// if (paramsMap.get("num") instanceof Integer) {
|
||||
// numLog.setNum(String.valueOf(paramsMap.get("num")));
|
||||
// } else if (paramsMap.get("num") instanceof String) {
|
||||
// numLog.setNum((String) paramsMap.get("num"));
|
||||
// }
|
||||
// }
|
||||
// if (paramsMap.containsKey("taskId")) {
|
||||
// numLog.setTask(String.valueOf(paramsMap.get("taskId")));
|
||||
// }
|
||||
// if (paramsMap.containsKey("typeId")) {
|
||||
// if (paramsMap.get("typeId") instanceof Integer) {
|
||||
// numLog.setTypeId((Integer) paramsMap.get("typeId"));
|
||||
// } else if (paramsMap.get("typeId") instanceof String) {
|
||||
// numLog.setTypeId(Integer.valueOf((String) paramsMap.get("typeId")));
|
||||
// }
|
||||
// }
|
||||
// numLog.setDescription(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter(excludeParamNames)), 0, 2000));
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 参数拼装
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.common.log.service;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.BmStorageLog;
|
||||
import com.bonus.sgzb.system.api.domain.BmNumLogs;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
|
|
@ -8,6 +9,8 @@ import com.bonus.sgzb.common.core.constant.SecurityConstants;
|
|||
import com.bonus.sgzb.system.api.RemoteLogService;
|
||||
import com.bonus.sgzb.system.api.domain.SysOperLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 异步调用日志服务
|
||||
*
|
||||
|
|
@ -35,4 +38,9 @@ public class AsyncLogService
|
|||
public void saveNumLog(BmNumLogs bmNumLogsLog) throws Exception {
|
||||
remoteLogService.saveNumberLog(bmNumLogsLog, SecurityConstants.INNER);
|
||||
}
|
||||
|
||||
@Async
|
||||
public void batchInsert(List<BmStorageLog> bmStorageLogList) throws Exception {
|
||||
remoteLogService.batchInsert(bmStorageLogList, SecurityConstants.INNER);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bonus.sgzb.app.controller;
|
||||
|
||||
import com.bonus.sgzb.app.domain.AppVersion;
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.CriticalData;
|
||||
import com.bonus.sgzb.app.domain.ToDoList;
|
||||
import com.bonus.sgzb.app.service.AppService;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,12 @@
|
|||
package com.bonus.sgzb.app.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.app.service.BackApplyService;
|
||||
import com.bonus.sgzb.app.service.LeaseApplyDetailsService;
|
||||
import com.bonus.sgzb.app.service.LeaseApplyInfoService;
|
||||
import com.bonus.sgzb.app.service.TmTaskService;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.GlobalConstants;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bonus.sgzb.app.controller;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.app.service.*;
|
||||
import com.bonus.sgzb.common.core.text.Convert;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
package com.bonus.sgzb.app.controller;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.MaInputVO;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputVO;
|
||||
import com.bonus.sgzb.app.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.app.domain.PurchaseMacodeInfo;
|
||||
import com.bonus.sgzb.app.service.PurchaseInputService;
|
||||
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
|
|
|
|||
|
|
@ -1,201 +0,0 @@
|
|||
package com.bonus.sgzb.app.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 退料
|
||||
* @author bns_han
|
||||
*/
|
||||
@Data
|
||||
public class BackApplyInfo {
|
||||
/**
|
||||
* 退料id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 退料人
|
||||
*/
|
||||
private String userName;
|
||||
private String badId;
|
||||
private String[] typeIds;
|
||||
|
||||
@Excel(name = "退料状态",sort = 9)
|
||||
private String taskName;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@Excel(name = "联系电话",sort = 6)
|
||||
private String phone;
|
||||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@Excel(name = "退料工程",sort = 3)
|
||||
private String lotName;
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@Excel(name = "退料单位",sort = 2)
|
||||
private String unitName;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private String planStartTime;
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 退料审核状态
|
||||
*/
|
||||
private String taskStatus;
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
private String typeId;
|
||||
private String modelId;
|
||||
|
||||
private List<MachinePart> maTypeDetails;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@Excel(name = "退料机具",sort = 4)
|
||||
private String typeName;
|
||||
/**
|
||||
* 协议号
|
||||
*/
|
||||
@Excel(name = "协议号",sort = 8)
|
||||
private String agreementCode;
|
||||
/**
|
||||
* 规格编号
|
||||
*/
|
||||
private String typeCode;
|
||||
/**
|
||||
* 组织id
|
||||
*/
|
||||
private String companyId;
|
||||
/**
|
||||
* 在用数量
|
||||
*/
|
||||
private String num;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String maCode;
|
||||
/**
|
||||
* 协议id
|
||||
*/
|
||||
private String agreementId;
|
||||
/**
|
||||
* 人员
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String updateBy;
|
||||
private String updateTime;
|
||||
private String remark;
|
||||
/**
|
||||
* 审核备注
|
||||
*/
|
||||
private String directAuditRemark;
|
||||
@Excel(name = "退料单号",sort = 1)
|
||||
private String code;
|
||||
@Excel(name = "退料人员",sort = 5)
|
||||
private String backPerson;
|
||||
private String lotId;
|
||||
private String unitId;
|
||||
@Excel(name = "申请时间",sort = 7)
|
||||
private String backTime;
|
||||
private Integer maId;
|
||||
/**
|
||||
* 机具管理方式
|
||||
*/
|
||||
private String manageType;
|
||||
private String type;
|
||||
/**
|
||||
* 合格数量
|
||||
*/
|
||||
private Integer passNum;
|
||||
/**
|
||||
* 维修数量
|
||||
*/
|
||||
private Integer maintenanceNum;
|
||||
/**
|
||||
* 报废数量
|
||||
*/
|
||||
private Integer scrapNum;
|
||||
|
||||
/**
|
||||
* 退料数量
|
||||
*/
|
||||
private Integer backNum;
|
||||
|
||||
/**
|
||||
* 退料状态
|
||||
*/
|
||||
private String backStatus;
|
||||
|
||||
/**
|
||||
* 合格入库数量
|
||||
*/
|
||||
private String inputNum;
|
||||
|
||||
/**
|
||||
* 关键字
|
||||
*/
|
||||
private String keyWord;
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
private Integer taskType;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
private Integer taskId;
|
||||
|
||||
private BackApplyInfo info;
|
||||
|
||||
private BackApplyInfo[] arr;
|
||||
private List<BackApplyInfo> backApplyDetails;
|
||||
private Integer parentId;
|
||||
private String sdStatus;
|
||||
private String sdId;
|
||||
/**
|
||||
* 二维码编码
|
||||
*/
|
||||
private String qrCode;
|
||||
/**
|
||||
* rfid编码
|
||||
*/
|
||||
private String rfidCode;
|
||||
private String repairedNum;
|
||||
private String backId;
|
||||
private String repairer;
|
||||
/**
|
||||
* 退料数量
|
||||
*/
|
||||
private String preNum;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
private Integer flag;
|
||||
private Integer partNum;
|
||||
/**
|
||||
* 合格数量
|
||||
*/
|
||||
private Integer hgNum;
|
||||
/**
|
||||
* 维修数量
|
||||
*/
|
||||
private Integer wxNum;
|
||||
/**
|
||||
* 报废数量
|
||||
*/
|
||||
private Integer bfNum;
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.app.domain;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
|
|
|||
|
|
@ -1,168 +0,0 @@
|
|||
package com.bonus.sgzb.app.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 入库记录ma_input_record对象 ma_input_record
|
||||
*
|
||||
* @author bonus
|
||||
* @date 2023-12-15
|
||||
*/
|
||||
public class MaInputRecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
@ApiModelProperty(value = "主键id")
|
||||
private Long id;
|
||||
|
||||
/** 任务ID */
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private Long taskId;
|
||||
|
||||
/** 类型ID */
|
||||
@ApiModelProperty(value = "类型ID")
|
||||
private Long typeId;
|
||||
|
||||
/** 机具ID */
|
||||
@ApiModelProperty(value = "机具ID")
|
||||
private Long maId;
|
||||
|
||||
/** 入库类型(1新购入库,2退料入库,3修试后入库) */
|
||||
@ApiModelProperty(value = "入库类型(1新购入库,2退料入库,3修试后入库)")
|
||||
private String inputType;
|
||||
|
||||
/** 入库数量 */
|
||||
@ApiModelProperty(value = "入库数量")
|
||||
private BigDecimal inputNum;
|
||||
|
||||
/** 状态(0删除,1正常) */
|
||||
@ApiModelProperty(value = "状态 0=删除,1正常")
|
||||
private String status;
|
||||
|
||||
/** 数据所属组织 */
|
||||
@ApiModelProperty(value = "数据所属组织")
|
||||
private Long companyId;
|
||||
|
||||
@ApiModelProperty(value = "验收结论")
|
||||
private String checkResult;
|
||||
|
||||
@ApiModelProperty(value = "机具编号")
|
||||
private String maCode;
|
||||
|
||||
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setTaskId(Long taskId)
|
||||
{
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public Long getTaskId()
|
||||
{
|
||||
return taskId;
|
||||
}
|
||||
public void setTypeId(Long typeId)
|
||||
{
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public Long getTypeId()
|
||||
{
|
||||
return typeId;
|
||||
}
|
||||
public void setMaId(Long maId)
|
||||
{
|
||||
this.maId = maId;
|
||||
}
|
||||
|
||||
public Long getMaId()
|
||||
{
|
||||
return maId;
|
||||
}
|
||||
public void setInputType(String inputType)
|
||||
{
|
||||
this.inputType = inputType;
|
||||
}
|
||||
|
||||
public String getInputType()
|
||||
{
|
||||
return inputType;
|
||||
}
|
||||
public void setInputNum(BigDecimal inputNum)
|
||||
{
|
||||
this.inputNum = inputNum;
|
||||
}
|
||||
|
||||
public BigDecimal getInputNum()
|
||||
{
|
||||
return inputNum;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setCompanyId(Long companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public Long getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
|
||||
|
||||
public String getCheckResult() {
|
||||
return checkResult;
|
||||
}
|
||||
|
||||
public void setCheckResult(String checkResult) {
|
||||
this.checkResult = checkResult;
|
||||
}
|
||||
|
||||
public String getMaCode() {
|
||||
return maCode;
|
||||
}
|
||||
|
||||
public void setMaCode(String maCode) {
|
||||
this.maCode = maCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("taskId", getTaskId())
|
||||
.append("typeId", getTypeId())
|
||||
.append("maId", getMaId())
|
||||
.append("inputType", getInputType())
|
||||
.append("inputNum", getInputNum())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("companyId", getCompanyId())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
package com.bonus.sgzb.app.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class MaInputVO {
|
||||
|
||||
|
||||
/** 任务ID */
|
||||
@ApiModelProperty(value = "任务ID")
|
||||
private Long taskId;
|
||||
|
||||
@ApiModelProperty(value = "验收结论")
|
||||
private String checkResult;
|
||||
|
||||
/**
|
||||
* 入库记录
|
||||
*/
|
||||
private List<MaInputRecord> inputRecordList;
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.app.domain;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.common.core.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package com.bonus.sgzb.app.mapper;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
||||
import com.bonus.sgzb.app.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bonus.sgzb.app.mapper;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
@ -77,6 +77,9 @@ public interface BackReceiveMapper {
|
|||
*/
|
||||
int updateMaStatus(@Param("maId") int maId,@Param("maStatus") String maStatus);
|
||||
|
||||
|
||||
int getmaChineByCt(BackApplyInfo record);
|
||||
|
||||
/**
|
||||
* getHgList
|
||||
* @param record
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package com.bonus.sgzb.app.mapper;
|
||||
|
||||
import com.bonus.sgzb.app.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.app.domain.StorageStatus;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.base.domain.MaSupplierInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.bonus.sgzb.app.mapper;
|
||||
|
||||
import com.bonus.sgzb.app.domain.LeaseApplyDetails;
|
||||
import com.bonus.sgzb.app.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.app.mapper;
|
||||
|
||||
import com.bonus.sgzb.app.domain.*;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
package com.bonus.sgzb.app.mapper;
|
||||
|
||||
import com.bonus.sgzb.app.domain.*;
|
||||
import com.bonus.sgzb.base.domain.MaintenanceGang;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bonus.sgzb.app.service;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bonus.sgzb.app.service;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bonus.sgzb.app.service;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.MaInputVO;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputVO;
|
||||
import com.bonus.sgzb.app.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.app.domain.PurchaseMacodeInfo;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +1,20 @@
|
|||
package com.bonus.sgzb.app.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.BmAgreementInfo;
|
||||
import com.bonus.sgzb.app.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.app.mapper.BackApplyAppMapper;
|
||||
import com.bonus.sgzb.app.service.BackApplyService;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author hay
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.bonus.sgzb.app.service.impl;
|
||||
|
||||
import com.bonus.sgzb.app.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.app.mapper.BackReceiveMapper;
|
||||
import com.bonus.sgzb.app.mapper.TmTaskMapper;
|
||||
|
|
@ -11,7 +11,6 @@ import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
|||
import com.bonus.sgzb.common.core.enums.TaskStatusEnum;
|
||||
import com.bonus.sgzb.common.core.enums.TaskTypeEnum;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -54,9 +53,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
typeIds.removeIf(item -> item == null);
|
||||
for (TmTask typeId : typeIds) {
|
||||
MachinePart machinePart = tmTaskMapper.getMachineParts(typeId);
|
||||
machinePart.setParentId(record.getId());
|
||||
machinePart.setParentId(record.getId().intValue());
|
||||
int countMachineByPidAndTid = tmTaskMapper.getCountMachineByPidAndTid(machinePart);
|
||||
Double machinePartNum = typeId.getPartNum() * Double.parseDouble(backApplyInfo.getPreNum());
|
||||
Double machinePartNum = typeId.getPartNum() * Double.parseDouble(backApplyInfo.getAuditNum());
|
||||
count1 += machinePartNum;
|
||||
count2 += countMachineByPidAndTid;
|
||||
machinePart.setPartNum(machinePartNum - countMachineByPidAndTid);
|
||||
|
|
@ -66,7 +65,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if (count1 == count2) {
|
||||
backApplyInfo.setPartNum(0);
|
||||
} else {
|
||||
backApplyInfo.setPartNum((int) Double.parseDouble(backApplyInfo.getPreNum()));
|
||||
backApplyInfo.setPartNum((int) Double.parseDouble(backApplyInfo.getAuditNum()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -147,6 +146,17 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
int res;
|
||||
// try {
|
||||
int taskId = record.getTaskId();
|
||||
int passNum = 0;
|
||||
int maintenanceNum = 0;
|
||||
int scrapNum = 0;
|
||||
List<BackApplyInfo> allList1 = backReceiveMapper.getAllList(record);
|
||||
if (allList1 != null && allList1.size() > 0) {
|
||||
BackApplyInfo b = allList1.get(0);
|
||||
record.setTypeId(b.getTypeId());
|
||||
int num = backReceiveMapper.getmaChineByCt(record);
|
||||
record.setNum(String.valueOf(num));
|
||||
}
|
||||
|
||||
//先判断是否已经完成退料了
|
||||
int taskStatus = selectTaskStatus(taskId);
|
||||
if (taskStatus == 0) {
|
||||
|
|
@ -182,7 +192,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if (res == 0) {
|
||||
throw new RuntimeException("ma_machines");
|
||||
}
|
||||
|
||||
for (BackApplyInfo bi : hgList) {
|
||||
passNum += bi.getBackNum();
|
||||
}
|
||||
}
|
||||
//维修的创建维修任务,插入任务协议表
|
||||
List<BackApplyInfo> wxList = backReceiveMapper.getWxList(record);
|
||||
|
|
@ -193,6 +205,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
res = insertTta(newTaskId, wxList);
|
||||
//插入维修记录表repair_apply_details
|
||||
res = insertRad(newTaskId, wxList);
|
||||
for (BackApplyInfo bi : wxList) {
|
||||
maintenanceNum += bi.getBackNum();
|
||||
}
|
||||
}
|
||||
//待报废的创建报废任务,插入任务协议表
|
||||
|
||||
|
|
@ -204,6 +219,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
res = insertTta(newTaskId, bfList);
|
||||
//插入维修记录表scrap_apply_details
|
||||
res = insertSad(newTaskId, bfList);
|
||||
for (BackApplyInfo bi : bfList) {
|
||||
scrapNum += bi.getBackNum();
|
||||
}
|
||||
}
|
||||
|
||||
List<BackApplyInfo> allList = backReceiveMapper.getAllList(record);
|
||||
|
|
@ -212,7 +230,18 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if (res == 0) {
|
||||
throw new RuntimeException("该机具未被领料使用");
|
||||
}
|
||||
BackApplyInfo b = allList.get(0);
|
||||
record.setTypeId(b.getTypeId());
|
||||
int postStoreNum = backReceiveMapper.getmaChineByCt(record);
|
||||
record.setPostStoreNum(postStoreNum);
|
||||
}
|
||||
|
||||
//库存日志
|
||||
record.setBackNum(passNum+maintenanceNum+scrapNum);
|
||||
record.setPassNum(passNum);
|
||||
record.setMaintenanceNum(maintenanceNum);
|
||||
record.setScrapNum(scrapNum);
|
||||
|
||||
// } catch (Exception e) {
|
||||
// throw new RuntimeException(e.getMessage());
|
||||
// }
|
||||
|
|
@ -387,7 +416,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
|
||||
private int insertTta(int taskId, List<BackApplyInfo> list) {
|
||||
int res;
|
||||
String agreementId = list.get(0).getAgreementId();
|
||||
String agreementId = String.valueOf(list.get(0).getAgreementId());
|
||||
res = backReceiveMapper.insertTta(taskId, agreementId);
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bonus.sgzb.app.service.impl;
|
||||
|
||||
import com.bonus.sgzb.app.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.app.domain.StorageStatus;
|
||||
import com.bonus.sgzb.app.mapper.HoldingLedgerMapper;
|
||||
import com.bonus.sgzb.app.service.HoldingLedgerService;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.bonus.sgzb.app.service.impl;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.sgzb.app.domain.LeaseApplyDetails;
|
||||
import com.bonus.sgzb.app.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper;
|
||||
import com.bonus.sgzb.app.mapper.LeaseOutDetailsMapper;
|
||||
|
|
@ -181,6 +181,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
if (res == 0) {
|
||||
throw new RuntimeException("出库失败,插入结算记录失败");
|
||||
}
|
||||
record.setPostStoreNum(getStorageNum(record));
|
||||
} else {
|
||||
return AjaxResult.error("领料出库失败,机具库存不足");
|
||||
}
|
||||
|
|
@ -194,6 +195,18 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
return AjaxResult.success("出库成功");
|
||||
}
|
||||
|
||||
private int getStorageNum(LeaseOutDetails record) {
|
||||
if (StringUtils.isNull(record)) {
|
||||
return 0;
|
||||
}
|
||||
//判断(ma_type 设备规格表)中的库存够不够出库的
|
||||
MaType maType = leaseOutDetailsMapper.selectByTypeId(record);
|
||||
if (maType != null) {
|
||||
return maType.getNum().intValue();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private int insertRecords(LeaseOutDetails record) {
|
||||
int res = 0;
|
||||
// 首先更新领料任务详情表的领料数及状态(lease_apply_details)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.bonus.sgzb.app.service.impl;
|
|||
import com.bonus.sgzb.app.domain.*;
|
||||
import com.bonus.sgzb.app.mapper.PurchaseInputMapper;
|
||||
import com.bonus.sgzb.app.service.PurchaseInputService;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputVO;
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.bonus.sgzb.app.service.impl;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.sgzb.app.domain.LeaseApplyDetails;
|
||||
import com.bonus.sgzb.app.domain.LeaseApplyInfo;
|
||||
import com.bonus.sgzb.app.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.app.domain.TmTask;
|
||||
import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper;
|
||||
import com.bonus.sgzb.app.mapper.LeaseApplyInfoMapper;
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@
|
|||
bui.unit_id=#{unitId}
|
||||
and bui.del_flag='0'
|
||||
</select>
|
||||
<select id="getbackList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="getbackList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id,
|
||||
bai.`code`,
|
||||
|
|
@ -417,7 +417,7 @@
|
|||
ORDER BY bai.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="materialList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="materialList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt.type_id,
|
||||
mt.type_name as typeCode,
|
||||
|
|
@ -441,7 +441,7 @@
|
|||
mt.type_id
|
||||
</select>
|
||||
|
||||
<select id="view" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="view" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt.type_name typeCode,
|
||||
CONCAT_WS('/', IFNULL(mt2.type_name, '')) AS typeName,
|
||||
|
|
@ -454,7 +454,7 @@
|
|||
WHERE
|
||||
bai.id=#{id}
|
||||
</select>
|
||||
<select id="examineList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="examineList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id,
|
||||
bai.code,
|
||||
|
|
@ -487,7 +487,7 @@
|
|||
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
|
||||
ORDER BY bai.create_time desc
|
||||
</select>
|
||||
<select id="examineView" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="examineView" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt.type_name typeCode,
|
||||
CONCAT_WS('/', IFNULL(mt2.type_name, '')) AS typeName,
|
||||
|
|
@ -504,7 +504,7 @@
|
|||
WHERE
|
||||
bai.id=#{id}
|
||||
</select>
|
||||
<select id="selectBackApplyInfo" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="selectBackApplyInfo" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT * FROM tm_task tt
|
||||
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
||||
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||
|
|
@ -527,7 +527,7 @@
|
|||
WHERE
|
||||
mt1.type_id = #{typeId}
|
||||
</select>
|
||||
<select id="getMachineParts" resultType="com.bonus.sgzb.app.domain.MachinePart">
|
||||
<select id="getMachineParts" resultType="com.bonus.sgzb.base.api.domain.MachinePart">
|
||||
SELECT
|
||||
mt.type_name AS typeModelName,
|
||||
mt.unit_name as unitName,
|
||||
|
|
|
|||
|
|
@ -542,8 +542,8 @@
|
|||
)
|
||||
</insert>
|
||||
<insert id="insStlInfoTwo">
|
||||
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id)
|
||||
values (#{info.agreementId},#{info.typeId},#{info.maId},#{many},#{info.startTime},#{info.status},#{info.leaseId},#{info.leasePrice},#{info.buyPrice},'0',#{info.companyId});
|
||||
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id,lease_type)
|
||||
values (#{info.agreementId},#{info.typeId},#{info.maId},#{many},#{info.startTime},#{info.status},#{info.leaseId},#{info.leasePrice},#{info.buyPrice},'0',#{info.companyId},#{info.leaseType});
|
||||
</insert>
|
||||
|
||||
|
||||
|
|
@ -585,7 +585,7 @@
|
|||
</if>
|
||||
</delete>
|
||||
|
||||
<select id="getbackReceiveList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="getbackReceiveList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id,
|
||||
bai.`code`,
|
||||
|
|
@ -654,7 +654,7 @@
|
|||
bai.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="receiveView" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="receiveView" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id,
|
||||
bai.task_id as taskId,
|
||||
|
|
@ -664,7 +664,8 @@
|
|||
mt.type_name as typeCode,
|
||||
mt.unit_name as unitName,
|
||||
mt2.type_name AS typeName,
|
||||
bad.audit_num as preNum,
|
||||
bad.pre_num as preNum,
|
||||
bad.audit_num as auditNum,
|
||||
bad.status as status,
|
||||
IFNULL(bad.audit_num,0)-IFNULL(aa.back_num,0) as num,
|
||||
mt.manage_type as manageType,
|
||||
|
|
@ -695,10 +696,15 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getmaChineByCt" resultType="java.lang.Integer">
|
||||
select num from ma_type WHERE type_id = #{typeId}
|
||||
</select>
|
||||
|
||||
<select id="selectTaskNumByMonthWx" resultType="java.lang.Integer">
|
||||
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{taskType}
|
||||
</select>
|
||||
<select id="getHgList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
|
||||
<select id="getHgList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
tta.agreement_id as agreementId,
|
||||
bai.id,
|
||||
|
|
@ -718,7 +724,7 @@
|
|||
and bcd.back_status='1'
|
||||
</select>
|
||||
|
||||
<select id="getWxList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="getWxList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
tta.agreement_id as agreementId,
|
||||
bai.id,
|
||||
|
|
@ -738,7 +744,7 @@
|
|||
and bcd.back_status='2'
|
||||
</select>
|
||||
|
||||
<select id="getBfList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="getBfList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
tta.agreement_id as agreementId,
|
||||
bai.id,
|
||||
|
|
@ -758,7 +764,7 @@
|
|||
and bcd.back_status='3'
|
||||
</select>
|
||||
|
||||
<select id="codeQuery" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="codeQuery" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt.type_id as typeId,
|
||||
mm.ma_id as maId,
|
||||
|
|
@ -776,7 +782,7 @@
|
|||
and sd.id='16'
|
||||
</select>
|
||||
|
||||
<select id="qrcodeQuery" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="qrcodeQuery" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt.type_id as typeId,
|
||||
mm.ma_id as maId,
|
||||
|
|
@ -794,7 +800,7 @@
|
|||
WHERE
|
||||
mm.qr_code =#{qrCode} and sai.agreement_id = #{agreementId}
|
||||
</select>
|
||||
<select id="backReceiveRecord" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="backReceiveRecord" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt2.type_name AS typeName,
|
||||
mt1.type_name AS typeCode,
|
||||
|
|
@ -827,7 +833,7 @@
|
|||
AND bai.task_id = #{taskId}
|
||||
</select>
|
||||
|
||||
<select id="rfidCodeQuery" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="rfidCodeQuery" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt.type_id as typeId,
|
||||
mm.ma_id as maId,
|
||||
|
|
@ -855,6 +861,7 @@
|
|||
end_time AS endTime,
|
||||
status AS status,
|
||||
lease_id AS leaseId,
|
||||
lease_type AS leaseType,
|
||||
back_id AS backId,
|
||||
lease_price AS leasePrice,
|
||||
buy_price AS buyPrice,
|
||||
|
|
@ -870,7 +877,7 @@
|
|||
</if>
|
||||
order by start_time asc
|
||||
</select>
|
||||
<select id="getAllList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="getAllList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
tta.agreement_id AS agreementId,
|
||||
bai.id,
|
||||
|
|
@ -960,7 +967,7 @@
|
|||
) res
|
||||
HAVING backNum > -1
|
||||
</select>
|
||||
<select id="backReceiveRecordWeb" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="backReceiveRecordWeb" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt2.type_name AS typeName,
|
||||
mt1.type_name AS typeCode,
|
||||
|
|
@ -988,7 +995,7 @@
|
|||
ORDER BY
|
||||
bcd.create_time DESC
|
||||
</select>
|
||||
<select id="getCtList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="getCtList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bad.type_id as typeId,
|
||||
ifnull(bad.audit_num,0) as backNum,
|
||||
|
|
@ -999,7 +1006,7 @@
|
|||
WHERE
|
||||
bad.parent_id = #{parentId}
|
||||
</select>
|
||||
<select id="backReceiveRecordWebPt" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
<select id="backReceiveRecordWebPt" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
mt2.type_name AS typeName,
|
||||
mt1.type_name AS typeCode,
|
||||
|
|
|
|||
|
|
@ -424,7 +424,7 @@
|
|||
WHERE
|
||||
mt1.type_id = #{typeId}
|
||||
</select>
|
||||
<select id="getMachineParts" resultType="com.bonus.sgzb.app.domain.MachinePart">
|
||||
<select id="getMachineParts" resultType="com.bonus.sgzb.base.api.domain.MachinePart">
|
||||
SELECT
|
||||
mt.type_name AS typeModelName,
|
||||
mt.unit_name as unitName,
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
<if test="companyId != null">#{companyId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertMaInputRecord" parameterType="com.bonus.sgzb.app.domain.MaInputRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
<insert id="insertMaInputRecord" parameterType="com.bonus.sgzb.base.api.domain.MaInputRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into ma_input_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null">task_id,</if>
|
||||
|
|
|
|||
|
|
@ -1081,7 +1081,7 @@
|
|||
WHERE
|
||||
mt1.type_id = #{typeId}
|
||||
</select>
|
||||
<select id="getMachineParts" resultType="com.bonus.sgzb.app.domain.MachinePart">
|
||||
<select id="getMachineParts" resultType="com.bonus.sgzb.base.api.domain.MachinePart">
|
||||
SELECT
|
||||
mt.type_name AS typeModelName,
|
||||
mt.type_id as modelId,
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and mt.type_id = #{typeId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="getWholeSetDetails" resultType="com.bonus.sgzb.app.domain.MachinePart">
|
||||
<select id="getWholeSetDetails" resultType="com.bonus.sgzb.base.api.domain.MachinePart">
|
||||
SELECT
|
||||
mt2.type_name AS typeModelName,
|
||||
mt2.type_id AS typeId,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties
|
|||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 文件服务
|
||||
|
|
@ -18,6 +19,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|||
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
||||
@EnableCustomConfig
|
||||
@EnableRyFeignClients
|
||||
@EnableScheduling
|
||||
@EnableEncryptableProperties
|
||||
public class SgzbMaterialApplication
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import com.bonus.sgzb.common.log.annotation.Log;
|
|||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.BackApplyDto;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.service.BackApplyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
|||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.material.domain.PutInStorageBean;
|
||||
import com.bonus.sgzb.material.domain.SavePutInfoDto;
|
||||
import com.bonus.sgzb.base.api.domain.SavePutInfoDto;
|
||||
import com.bonus.sgzb.material.service.InventoryAndWarehousingService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
|
|||
|
|
@ -5,10 +5,7 @@ import com.bonus.sgzb.common.core.web.controller.BaseController;
|
|||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.LeaseRecord;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.service.BackApplyService;
|
||||
import com.bonus.sgzb.material.service.LeaseRecordService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import com.bonus.sgzb.common.log.annotation.Log;
|
|||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
import com.bonus.sgzb.material.service.IPurchaseAccessoryService;
|
||||
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
package com.bonus.sgzb.material.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.MachinePart;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
|
|
|
|||
|
|
@ -10,12 +10,8 @@ import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
|||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
||||
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
|
||||
import com.bonus.sgzb.material.service.PurchaseCheckServiceCenterService;
|
||||
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||
import com.bonus.sgzb.system.api.model.LoginUser;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
|||
|
|
@ -5,13 +5,9 @@ import javax.servlet.http.HttpServletResponse;
|
|||
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.material.domain.LeaseApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService;
|
||||
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
||||
import com.bonus.sgzb.material.service.LeaseRecordService;
|
||||
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
||||
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.RepairTestInputDetailVo;
|
||||
import com.bonus.sgzb.material.domain.RepairTestInputDto;
|
||||
import com.bonus.sgzb.material.domain.RepairTestInputVo;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.sgzb.common.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo;
|
||||
import com.bonus.sgzb.material.service.ReturnOfMaterialsInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.DirectApplyDetails;
|
||||
import com.bonus.sgzb.base.api.domain.DirectApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author:梁超
|
||||
* @date:2024/4/17 - 9:04
|
||||
*/
|
||||
@Data
|
||||
public class MachinePart {
|
||||
private String typeModelName;
|
||||
private String unitName;
|
||||
private String typeName;
|
||||
private Integer partNum;
|
||||
private Integer typeId;
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2024/8/5 - 14:28
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ProjectMonthCosts {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 协议id
|
||||
*/
|
||||
private Integer agreementId;
|
||||
/**
|
||||
* 结算记录关联id
|
||||
*/
|
||||
private Integer sltMonthId;
|
||||
/**
|
||||
* 单位id
|
||||
*/
|
||||
private Integer unitId;
|
||||
/**
|
||||
*工程id
|
||||
*/
|
||||
private Integer projectId;
|
||||
/**
|
||||
* 结算月份
|
||||
*/
|
||||
private String month;
|
||||
/**
|
||||
* 费用承担方
|
||||
*/
|
||||
private String costBearingParty;
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
private String costs;
|
||||
private List<ProjectMonthDetail> node;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.bonus.sgzb.material.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
* @Date:2024/8/5 - 15:08
|
||||
*/
|
||||
@Data
|
||||
public class ProjectMonthDetail {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 类型id
|
||||
*/
|
||||
private Integer typeId;
|
||||
/**
|
||||
* 编码id
|
||||
*/
|
||||
private Integer maId;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
private String startTime;
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
private String endTime;
|
||||
/**
|
||||
* 结算天数
|
||||
*/
|
||||
private String sltDays;
|
||||
/**
|
||||
* 结算金额
|
||||
*/
|
||||
private String sltCosts;
|
||||
/**
|
||||
* 本月暂计金额
|
||||
*/
|
||||
private String monthTemporarilyCosts;
|
||||
/**
|
||||
* 月结算关联id
|
||||
*/
|
||||
private Integer proMonthCostId;
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private String num;
|
||||
/**
|
||||
* 结算月份
|
||||
*/
|
||||
private String month;
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private String leasePrice;
|
||||
/**
|
||||
* 费用承担方
|
||||
*/
|
||||
private String costBearingParty;
|
||||
private String leaseDays;
|
||||
private String nuitName;
|
||||
private String costs;
|
||||
private String realCosts;
|
||||
}
|
||||
|
|
@ -33,6 +33,12 @@ public class PurchaseMacodeInfo extends BaseEntity
|
|||
@ApiModelProperty(value = "类型ID")
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 库存数量
|
||||
*/
|
||||
@ApiModelProperty(value = "库存数量")
|
||||
private Double num;
|
||||
|
||||
/** 机具编号 */
|
||||
@ApiModelProperty(value = "机具编号")
|
||||
private String maCode;
|
||||
|
|
@ -118,6 +124,16 @@ public class PurchaseMacodeInfo extends BaseEntity
|
|||
@ApiModelProperty(value = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
private String userId;
|
||||
|
||||
/** 审核员用户id */
|
||||
@ApiModelProperty(value = "审核员用户id")
|
||||
private List<String> userIds;
|
||||
|
|
@ -173,7 +189,16 @@ public class PurchaseMacodeInfo extends BaseEntity
|
|||
{
|
||||
return typeId;
|
||||
}
|
||||
public void setMaCode(String maCode)
|
||||
|
||||
public Double getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Double num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public void setMaCode(String maCode)
|
||||
{
|
||||
this.maCode = maCode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,4 +81,6 @@ public interface AgreementInfoMapper {
|
|||
* @return int
|
||||
*/
|
||||
int selectByagreementId(Long agreementId);
|
||||
|
||||
List<AgreementInfo> getAllAgreementId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.material.domain.BackApplyDto;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.TypeTreeNode;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.BackRecord;
|
||||
import com.bonus.sgzb.material.domain.LeaseRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.CalMonthlyBean;
|
||||
import com.bonus.sgzb.material.domain.ProjectMonthCosts;
|
||||
import com.bonus.sgzb.material.domain.ProjectMonthDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -26,4 +30,13 @@ public interface CalMonthlyMapper {
|
|||
|
||||
int deleteMonthlyCosts(CalMonthlyBean bean);
|
||||
|
||||
int insertProMonCosts(ProjectMonthCosts projectMonthCosts);
|
||||
|
||||
int insertProjectMonthDetail(ProjectMonthDetail projectMonthDetail);
|
||||
|
||||
int updateProMonCosts(ProjectMonthCosts pmcId);
|
||||
|
||||
List<SltAgreementInfo> getMonthCosts(AgreementInfo agreementInfo);
|
||||
|
||||
List<SltAgreementInfo> getMonthDetails(SltAgreementInfo monthCost);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.material.domain.MachIneDto;
|
||||
import com.bonus.sgzb.base.api.domain.MachIneDto;
|
||||
import com.bonus.sgzb.material.domain.PutInStorageBean;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
|
|||
|
|
@ -3,13 +3,10 @@ package com.bonus.sgzb.material.mapper;
|
|||
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.LeaseRecord;
|
||||
import com.bonus.sgzb.material.domain.TypeTreeNode;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.material.domain.BmNoticeInfo;
|
||||
import com.bonus.sgzb.material.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import com.bonus.sgzb.base.api.domain.MaMachine;
|
|||
import com.bonus.sgzb.base.api.domain.MaMachineLabel;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.material.domain.InputApplyDetails;
|
||||
import com.bonus.sgzb.material.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.material.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.BackRecord;
|
||||
import com.bonus.sgzb.material.domain.RepairRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.RepairAuditDetails;
|
||||
import com.bonus.sgzb.material.domain.RepairRecord;
|
||||
import com.bonus.sgzb.material.domain.ScrapApplyDetails;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package com.bonus.sgzb.material.mapper;
|
||||
|
||||
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.ScrapApplyDetails;
|
||||
import com.bonus.sgzb.material.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
|
|
|||
|
|
@ -13,23 +13,20 @@ public class Inform {
|
|||
@Autowired
|
||||
private CalcMonthlyService calcfourCostService;
|
||||
|
||||
private final int CAL_DAY = 21;
|
||||
private final int CAL_DAY = 6;
|
||||
|
||||
@Scheduled(cron = "0 */5 * * * ? ") // 间隔5分钟执行
|
||||
//@Scheduled(cron = "0 0 1 22 * ? ") // 每个月22日凌晨1点执行
|
||||
// @Scheduled(cron = "0 */1 * * * ? ") // 间隔5分钟执行
|
||||
// @Scheduled(cron = "0 0 1 22 * ? ") // 每个月22日凌晨1点执行
|
||||
@Async
|
||||
public void taskCycle() {
|
||||
System.out.println("===springMVC定时器启动====");
|
||||
|
||||
try {
|
||||
|
||||
// 生成每月数据 (上月21日---本月20日)
|
||||
calcfourCostService.calcMonthInfo(CAL_DAY);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
System.out.println("===springMVC定时器结束====");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,52 +1,165 @@
|
|||
package com.bonus.sgzb.material.remind.service;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
||||
import com.bonus.sgzb.common.core.utils.DateTimeHelper;
|
||||
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.CalMonthlyBean;
|
||||
import com.bonus.sgzb.material.domain.ProjectMonthCosts;
|
||||
import com.bonus.sgzb.material.domain.ProjectMonthDetail;
|
||||
import com.bonus.sgzb.material.mapper.CalMonthlyMapper;
|
||||
import com.bonus.sgzb.material.mapper.SltAgreementInfoMapper;
|
||||
import com.bonus.sgzb.material.service.AgreementInfoService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
@Service
|
||||
public class CalcMonthlyServiceImp implements CalcMonthlyService {
|
||||
|
||||
@Resource
|
||||
CalMonthlyMapper calMonthlyMapper;
|
||||
@Resource
|
||||
CalMonthlyMapper calMonthlyMapper;
|
||||
|
||||
@Override
|
||||
public void calcMonthInfo(int day) throws Exception {
|
||||
String time = DateTimeHelper.getNowDate();
|
||||
String calDay = DateTimeHelper.getCalDay(day);
|
||||
if (time.equals(calDay)) {
|
||||
CalMonthlyBean record = new CalMonthlyBean();
|
||||
String month = DateTimeHelper.getCurrentMonth();
|
||||
record.setMonth(month);
|
||||
cleanSameMonthOldRecords(record);
|
||||
calMonthlyMapper.insertCalcRecord(record);
|
||||
String taskId = record.getId();
|
||||
String startTime = DateTimeHelper.getCalStartDay();
|
||||
String endTime = DateTimeHelper.getCalDay(day - 1);
|
||||
@Resource
|
||||
private AgreementInfoService agreementInfoService;
|
||||
|
||||
//TODO, use startTime, endTime, taskId to save monthly result to a new table.
|
||||
@Resource
|
||||
private SltAgreementInfoMapper sltAgreementInfoMapper;
|
||||
|
||||
@Override
|
||||
public void calcMonthInfo(int day) {
|
||||
String time = DateTimeHelper.getNowDate();
|
||||
String calDay = DateTimeHelper.getCalDay(day);
|
||||
if (time.equals(calDay)) {
|
||||
CalMonthlyBean record = new CalMonthlyBean();
|
||||
String month = DateTimeHelper.getCurrentMonth();
|
||||
record.setMonth(month);
|
||||
// cleanSameMonthOldRecords(record);
|
||||
List<AgreementInfo> list = agreementInfoService.getAllAgreementId();
|
||||
String startTime = DateTimeHelper.getCalStartDay();
|
||||
String endTime = DateTimeHelper.getCalDay(day - 1);
|
||||
list.forEach(t -> {
|
||||
t.setStartTime(startTime);
|
||||
t.setEndTime(endTime);
|
||||
});
|
||||
getLeaseListMonth(list, record);
|
||||
}
|
||||
}
|
||||
|
||||
private void cleanSameMonthOldRecords(CalMonthlyBean record) {
|
||||
List<CalMonthlyBean> list = calMonthlyMapper.getCalcRecords(record);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
for (CalMonthlyBean bean : list) {
|
||||
//清除上月之前计算过的记录 calc_project_month
|
||||
calMonthlyMapper.deleteCalcRecord(bean);
|
||||
|
||||
//清除上月之前计算过的记录 project_month_costs(表名待定)
|
||||
calMonthlyMapper.deleteMonthlyCosts(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<SltAgreementInfo> getLeaseListMonth(List<AgreementInfo> list, CalMonthlyBean record) {
|
||||
List<SltAgreementInfo> leaseList = new ArrayList<>();
|
||||
|
||||
for (AgreementInfo bean : list) {
|
||||
if (StringUtils.isNotBlank(bean.getStartTime()) && StringUtils.isNotBlank(bean.getEndTime())) {
|
||||
List<SltAgreementInfo> monthList = sltAgreementInfoMapper.getLeaseListMonthNotNull(bean);
|
||||
monthList.stream().filter(Objects::nonNull);
|
||||
for (SltAgreementInfo sltAgreementInfo : monthList) {
|
||||
calMonthlyMapper.insertCalcRecord(record);
|
||||
// slt_project_month的主键id
|
||||
String spmId = record.getId();
|
||||
ProjectMonthCosts projectMonthCosts = new ProjectMonthCosts();
|
||||
projectMonthCosts.setAgreementId(Integer.parseInt(sltAgreementInfo.getAgreementId()));
|
||||
projectMonthCosts.setSltMonthId(Integer.parseInt(spmId));
|
||||
projectMonthCosts.setUnitId(sltAgreementInfo.getUnitId());
|
||||
projectMonthCosts.setProjectId(sltAgreementInfo.getLotId());
|
||||
projectMonthCosts.setMonth(record.getMonth());
|
||||
projectMonthCosts.setCostBearingParty(sltAgreementInfo.getCostBearingParty());
|
||||
calMonthlyMapper.insertProMonCosts(projectMonthCosts);
|
||||
// project_month_costs的主键id
|
||||
int pmcId = projectMonthCosts.getId();
|
||||
|
||||
AgreementInfo agreementInfo = new AgreementInfo();
|
||||
agreementInfo.setAgreementId(bean.getAgreementId());
|
||||
agreementInfo.setCostBearingParty(sltAgreementInfo.getCostBearingParty());
|
||||
agreementInfo.setStartTime(sltAgreementInfo.getBeginTime());
|
||||
agreementInfo.setIds(sltAgreementInfo.getIds());
|
||||
sltAgreementInfo.setMonth(bean.getMonth());
|
||||
agreementInfo.setEndTime(sltAgreementInfo.getOffTime());
|
||||
List<SltAgreementInfo> leaseListOneMonth = getLeaseListOneMonth(agreementInfo, sltAgreementInfo, pmcId);
|
||||
projectMonthCosts.setCosts(sltAgreementInfo.getCosts());
|
||||
calMonthlyMapper.updateProMonCosts(projectMonthCosts);
|
||||
sltAgreementInfo.setNode(leaseListOneMonth);
|
||||
}
|
||||
leaseList.addAll(monthList);
|
||||
}
|
||||
}
|
||||
return leaseList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
private List<SltAgreementInfo> getLeaseListOneMonth(AgreementInfo list, SltAgreementInfo sltAgreementInfo, Integer pmcId) {
|
||||
ArrayList<String> idList = new ArrayList<>();
|
||||
String[] ids = list.getIds().split(",");
|
||||
for (String id : ids) {
|
||||
idList.add(id);
|
||||
}
|
||||
List<SltAgreementInfo> leaseList = sltAgreementInfoMapper.getLeaseListOneMonth(list, idList);
|
||||
BigDecimal leaseCostOne = BigDecimal.ZERO;
|
||||
for (SltAgreementInfo bean : leaseList) {
|
||||
if (bean.getLeasePrice() == null) {
|
||||
bean.setLeasePrice("0");
|
||||
}
|
||||
if (bean.getNum() == null) {
|
||||
bean.setNum("0");
|
||||
}
|
||||
if (bean.getLeaseDays() == null) {
|
||||
bean.setLeaseDays("0");
|
||||
}
|
||||
if (bean.getTrimDay() == null) {
|
||||
bean.setTrimDay(0);
|
||||
}
|
||||
BigDecimal leasePrice = new BigDecimal(bean.getLeasePrice());
|
||||
BigDecimal num = new BigDecimal(bean.getNum());
|
||||
BigDecimal leaseDays = new BigDecimal(bean.getLeaseDays());
|
||||
// 实际结算天数(领料天数 + 调整天数(可以为负整数))
|
||||
BigDecimal realDays = leaseDays.add(new BigDecimal(bean.getTrimDay()));
|
||||
// 实际结算金额
|
||||
BigDecimal realCosts = leasePrice.multiply(num).multiply(realDays);
|
||||
// 应结算金额
|
||||
BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays);
|
||||
bean.setCosts(String.valueOf(costs));
|
||||
bean.setRealDays(realDays);
|
||||
bean.setRealCosts(String.valueOf(realCosts));
|
||||
leaseCostOne = leaseCostOne.add(costs);
|
||||
bean.setMonth(sltAgreementInfo.getMonth());
|
||||
|
||||
private void cleanSameMonthOldRecords(CalMonthlyBean record) {
|
||||
List<CalMonthlyBean> list = calMonthlyMapper.getCalcRecords(record);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
for (CalMonthlyBean bean : list) {
|
||||
//清除上月之前计算过的记录 calc_project_month
|
||||
calMonthlyMapper.deleteCalcRecord(bean);
|
||||
|
||||
//清除上月之前计算过的记录 project_month_costs(表名待定)
|
||||
calMonthlyMapper.deleteMonthlyCosts(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
ProjectMonthDetail projectMonthDetail = new ProjectMonthDetail();
|
||||
projectMonthDetail.setTypeId(Integer.valueOf(bean.getTypeId()));
|
||||
if (bean.getMaId() != null){
|
||||
projectMonthDetail.setMaId(Integer.valueOf(bean.getMaId()));
|
||||
}
|
||||
projectMonthDetail.setUnit(bean.getNuitName());
|
||||
projectMonthDetail.setStartTime(bean.getStartTime());
|
||||
projectMonthDetail.setEndTime(bean.getEndTime());
|
||||
projectMonthDetail.setSltDays(bean.getLeaseDays());
|
||||
projectMonthDetail.setNum(bean.getNum());
|
||||
projectMonthDetail.setLeasePrice(bean.getLeasePrice());
|
||||
projectMonthDetail.setSltCosts(bean.getCosts());
|
||||
projectMonthDetail.setMonthTemporarilyCosts(bean.getRealCosts());
|
||||
projectMonthDetail.setProMonthCostId(pmcId);
|
||||
calMonthlyMapper.insertProjectMonthDetail(projectMonthDetail);
|
||||
}
|
||||
sltAgreementInfo.setCosts(String.valueOf(leaseCostOne));
|
||||
return leaseList;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,4 +64,6 @@ public interface AgreementInfoService {
|
|||
* @return
|
||||
*/
|
||||
List<AgreementInfo> exportList(AgreementInfo agreementInfo);
|
||||
|
||||
List<AgreementInfo> getAllAgreementId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.bonus.sgzb.material.service;
|
|||
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.BackApplyDto;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package com.bonus.sgzb.material.service;
|
||||
|
||||
import com.bonus.sgzb.material.domain.BmNoticeInfo;
|
||||
import com.bonus.sgzb.material.domain.MachinePart;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,8 @@ package com.bonus.sgzb.material.service;
|
|||
|
||||
import com.bonus.sgzb.base.api.domain.MaMachineLabel;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
||||
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
||||
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.bonus.sgzb.material.service;
|
|||
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.PutInStorageBean;
|
||||
import com.bonus.sgzb.material.domain.SavePutInfoDto;
|
||||
import com.bonus.sgzb.base.api.domain.SavePutInfoDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package com.bonus.sgzb.material.service;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.LeaseRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.bonus.sgzb.material.service;
|
|||
import com.bonus.sgzb.material.domain.PurchaseCheckInfo;
|
||||
import com.bonus.sgzb.material.domain.PurchaseInput;
|
||||
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
||||
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputVO;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
|
|||
import com.bonus.sgzb.base.api.domain.SltInfoVo;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -39,7 +40,7 @@ public interface SltAgreementInfoService {
|
|||
|
||||
int updateTrimDay(List<SltAgreementInfo> sltAgreementInfo);
|
||||
|
||||
List<SltAgreementInfo> getSltInfoMonth(List<AgreementInfo> list);
|
||||
List getSltInfoMonth(List<AgreementInfo> list);
|
||||
|
||||
int updateOutSourceCosts(SltAgreementInfo sltAgreementInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.bonus.sgzb.material.service;
|
||||
|
||||
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
package com.bonus.sgzb.material.service;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.*;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.DirectPassApplyInfoDetails;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,11 @@ public class AgreementInfoServiceImpl implements AgreementInfoService {
|
|||
return agreementInfoMapper.getAgreementInfoAll(agreementInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AgreementInfo> getAllAgreementId() {
|
||||
return agreementInfoMapper.getAllAgreementId();
|
||||
}
|
||||
|
||||
|
||||
private String purchaseCodeRule() {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
|
|
@ -150,7 +152,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
typeIds.removeIf(item -> item == null);
|
||||
for (TmTask typeId : typeIds) {
|
||||
MachinePart machinePart = tmTaskMapper.getMachineParts(typeId);
|
||||
machinePart.setPartNum((int) (Double.parseDouble(typeId.getPartNum()) * Double.parseDouble(backApplyInfo.getPreNum())));
|
||||
machinePart.setPartNum((Double.parseDouble(typeId.getPartNum()) * Double.parseDouble(backApplyInfo.getPreNum())));
|
||||
machineParts.add(machinePart);
|
||||
}
|
||||
backApplyInfo.setMaTypeDetails(machineParts);
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
|||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.config.ExceptionEnum;
|
||||
import com.bonus.sgzb.material.config.FieldGenerator;
|
||||
import com.bonus.sgzb.material.domain.MachIneDto;
|
||||
import com.bonus.sgzb.base.api.domain.MachIneDto;
|
||||
import com.bonus.sgzb.material.domain.PutInStorageBean;
|
||||
import com.bonus.sgzb.material.domain.SavePutInfoDto;
|
||||
import com.bonus.sgzb.base.api.domain.SavePutInfoDto;
|
||||
import com.bonus.sgzb.material.mapper.InventoryAndWarehousingMapper;
|
||||
import com.bonus.sgzb.material.service.InventoryAndWarehousingService;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
|
|
|
|||
|
|
@ -1,29 +1,12 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.LeaseRecord;
|
||||
import com.bonus.sgzb.material.domain.TypeTreeNode;
|
||||
import com.bonus.sgzb.material.mapper.BackApplyMapper;
|
||||
import com.bonus.sgzb.material.mapper.LeaseRecordMapper;
|
||||
import com.bonus.sgzb.material.mapper.TaskMapper;
|
||||
import com.bonus.sgzb.material.service.BackApplyService;
|
||||
import com.bonus.sgzb.material.service.LeaseRecordService;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
import com.bonus.sgzb.material.vo.TypeTreeBuild;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author hay
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.MachinePart;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
|
|
|
|||
|
|
@ -1,26 +1,22 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputRecord;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseCheckServiceCenterMapper;
|
||||
import com.bonus.sgzb.material.mapper.TaskMapper;
|
||||
import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
|
||||
import com.bonus.sgzb.material.service.PurchaseCheckServiceCenterService;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputVO;
|
||||
import com.bonus.sgzb.material.vo.NoticeInfoVO;
|
||||
import com.bonus.sgzb.system.api.RemoteUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import com.bonus.sgzb.material.service.IPurchaseCheckInfoService;
|
|||
import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||
import com.bonus.sgzb.base.api.domain.MaInputVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -71,7 +71,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
public List<PurchaseMacodeInfo> selectPurchaseMacodeInfoList(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||
List<PurchaseMacodeInfo> purchaseMacodeInfoList = purchaseMacodeInfoMapper.selectPurchaseMacodeInfoList(purchaseMacodeInfo);
|
||||
//判断有没有绑定固定资产
|
||||
if (purchaseMacodeInfoList.size() > 0 && purchaseMacodeInfoList.get(0).getFixCode()!=null){
|
||||
if (purchaseMacodeInfoList.size() > 0/* && purchaseMacodeInfoList.get(0).getFixCode()!=null*/){
|
||||
Map<Object,Long> groupCounts = purchaseMacodeInfoList.stream().map(PurchaseMacodeInfo::getTypeId).collect(Collectors.groupingBy(String::valueOf, Collectors.counting()));
|
||||
// 根据 typeId 进行去重
|
||||
purchaseMacodeInfoList = purchaseMacodeInfoList.stream()
|
||||
|
|
@ -433,12 +433,14 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
*/
|
||||
@Override
|
||||
public List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||
purchaseMacodeInfo.setUserId(userid.toString());
|
||||
List<PurchaseMacodeInfo> purchaseMacodeInfos = purchaseMacodeInfoMapper.selectPutinDetails(purchaseMacodeInfo);
|
||||
for (PurchaseMacodeInfo macodeInfo : purchaseMacodeInfos) {
|
||||
/* for (PurchaseMacodeInfo macodeInfo : purchaseMacodeInfos) {
|
||||
List<String> userIds = purchaseMacodeInfoMapper.selectKeepUser(macodeInfo.getTypeId().intValue());
|
||||
userIds.add("1");
|
||||
macodeInfo.setUserIds(userIds);
|
||||
}
|
||||
}*/
|
||||
return purchaseMacodeInfos;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import java.util.List;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.common.core.constant.TaskTypeConstants;
|
||||
import com.bonus.sgzb.common.core.enums.ReviewStatusEnum;
|
||||
import com.bonus.sgzb.common.core.enums.ScrapSourceEnum;
|
||||
|
|
@ -22,13 +23,10 @@ import com.bonus.sgzb.material.exception.ExceptionDict;
|
|||
import com.bonus.sgzb.material.mapper.*;
|
||||
import com.bonus.sgzb.material.service.IScrapApplyDetailsService;
|
||||
import com.bonus.sgzb.material.vo.ForecastWasteExcel;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO;
|
||||
import com.bonus.sgzb.material.vo.ScrapAudit;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.catalina.security.SecurityUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,16 +6,21 @@ import com.bonus.sgzb.base.api.domain.SltAgreementRelation;
|
|||
import com.bonus.sgzb.base.api.domain.SltInfoVo;
|
||||
|
||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||
import com.bonus.sgzb.common.core.utils.DateTimeHelper;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.AgreementInfo;
|
||||
import com.bonus.sgzb.material.domain.ProjectMonthCosts;
|
||||
import com.bonus.sgzb.material.domain.ProjectMonthDetail;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
|
||||
import com.bonus.sgzb.material.mapper.CalMonthlyMapper;
|
||||
import com.bonus.sgzb.material.mapper.SltAgreementInfoMapper;
|
||||
import com.bonus.sgzb.material.service.SltAgreementInfoService;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
|
|
@ -35,6 +40,9 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
@Resource
|
||||
private SltAgreementInfoMapper sltAgreementInfoMapper;
|
||||
|
||||
@Resource
|
||||
private CalMonthlyMapper calMonthlyMapper;
|
||||
|
||||
@Override
|
||||
public List<AgreementInfo> getSltAgreementInfo(AgreementInfo bean) {
|
||||
return sltAgreementInfoMapper.getSltAgreementInfo(bean);
|
||||
|
|
@ -397,52 +405,74 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<SltAgreementInfo> getSltInfoMonth(List<AgreementInfo> list) {
|
||||
public List getSltInfoMonth(List<AgreementInfo> list) {
|
||||
List<SltAgreementInfo> leaseListMonth = new ArrayList<>();
|
||||
Integer num = 0;
|
||||
//租赁费用列表
|
||||
List<SltAgreementInfo> leaseListMonth = getLeaseListMonth(list);
|
||||
for (AgreementInfo agreementInfo : list) {
|
||||
// 如果不选择具体日期或者选择了最新月份则需要查数据
|
||||
if (agreementInfo.getStartTime() == null || DateTimeHelper.getNowMonth().equals(DateTimeHelper.getNowMonth(DateTimeHelper.parse(agreementInfo.getEndTime(), "yyyy-MM")))) {
|
||||
List<SltAgreementInfo> listMonth = getLeaseListMonth(agreementInfo, num);
|
||||
leaseListMonth.addAll(listMonth);
|
||||
} else {
|
||||
// 查定时任务记录的数据
|
||||
List<SltAgreementInfo> listMonth = getLeaseJobListMonth(agreementInfo);
|
||||
leaseListMonth.addAll(listMonth);
|
||||
}
|
||||
}
|
||||
return leaseListMonth;
|
||||
}
|
||||
|
||||
private List<SltAgreementInfo> getLeaseJobListMonth(AgreementInfo agreementInfo) {
|
||||
List<SltAgreementInfo> monthCosts = calMonthlyMapper.getMonthCosts(agreementInfo);
|
||||
int num = 0;
|
||||
for (SltAgreementInfo monthCost : monthCosts) {
|
||||
monthCost.setCodeNum(num++);
|
||||
List<SltAgreementInfo> monthDetails = calMonthlyMapper.getMonthDetails(monthCost);
|
||||
monthCost.setNode(monthDetails);
|
||||
}
|
||||
return monthCosts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateOutSourceCosts(SltAgreementInfo sltAgreementInfo) {
|
||||
return sltAgreementInfoMapper.updateOutSourceCosts(sltAgreementInfo);
|
||||
}
|
||||
|
||||
private List<SltAgreementInfo> getLeaseListMonth(List<AgreementInfo> list) {
|
||||
private List<SltAgreementInfo> getLeaseListMonth(AgreementInfo bean, Integer num) {
|
||||
List<SltAgreementInfo> leaseList = new ArrayList<>();
|
||||
int num = 0;
|
||||
for (AgreementInfo bean : list) {
|
||||
if (StringUtils.isNotBlank(bean.getStartTime()) && StringUtils.isNotBlank(bean.getEndTime())) {
|
||||
List<SltAgreementInfo> monthList = sltAgreementInfoMapper.getLeaseListMonthNotNull(bean);
|
||||
for (SltAgreementInfo sltAgreementInfo : monthList) {
|
||||
AgreementInfo agreementInfo = new AgreementInfo();
|
||||
agreementInfo.setAgreementId(bean.getAgreementId());
|
||||
agreementInfo.setCostBearingParty(sltAgreementInfo.getCostBearingParty());
|
||||
agreementInfo.setStartTime(sltAgreementInfo.getBeginTime());
|
||||
agreementInfo.setIds(sltAgreementInfo.getIds());
|
||||
sltAgreementInfo.setMonth(bean.getMonth());
|
||||
sltAgreementInfo.setCodeNum(num++);
|
||||
agreementInfo.setEndTime(sltAgreementInfo.getOffTime());
|
||||
List<SltAgreementInfo> leaseListOneMonth = getLeaseListOneMonth(agreementInfo, sltAgreementInfo);
|
||||
sltAgreementInfo.setNode(leaseListOneMonth);
|
||||
}
|
||||
leaseList.addAll(monthList);
|
||||
} else {
|
||||
List<SltAgreementInfo> oneOfList = sltAgreementInfoMapper.getLeaseListMonth(bean);
|
||||
for (SltAgreementInfo sltAgreementInfo : oneOfList) {
|
||||
AgreementInfo agreementInfo = new AgreementInfo();
|
||||
agreementInfo.setAgreementId(bean.getAgreementId());
|
||||
agreementInfo.setIds(sltAgreementInfo.getIds());
|
||||
agreementInfo.setCostBearingParty(sltAgreementInfo.getCostBearingParty());
|
||||
agreementInfo.setStartTime(sltAgreementInfo.getBeginTime());
|
||||
sltAgreementInfo.setCodeNum(num++);
|
||||
agreementInfo.setEndTime(sltAgreementInfo.getOffTime());
|
||||
List<SltAgreementInfo> leaseListOneMonth = getLeaseListOneMonth(agreementInfo, sltAgreementInfo);
|
||||
sltAgreementInfo.setNode(leaseListOneMonth);
|
||||
}
|
||||
leaseList.addAll(oneOfList);
|
||||
// for (AgreementInfo bean : list) {
|
||||
if (StringUtils.isNotBlank(bean.getStartTime()) && StringUtils.isNotBlank(bean.getEndTime())) {
|
||||
List<SltAgreementInfo> monthList = sltAgreementInfoMapper.getLeaseListMonthNotNull(bean);
|
||||
for (SltAgreementInfo sltAgreementInfo : monthList) {
|
||||
AgreementInfo agreementInfo = new AgreementInfo();
|
||||
agreementInfo.setAgreementId(bean.getAgreementId());
|
||||
agreementInfo.setCostBearingParty(sltAgreementInfo.getCostBearingParty());
|
||||
agreementInfo.setStartTime(sltAgreementInfo.getBeginTime());
|
||||
agreementInfo.setIds(sltAgreementInfo.getIds());
|
||||
sltAgreementInfo.setMonth(bean.getMonth());
|
||||
sltAgreementInfo.setCodeNum(num++);
|
||||
agreementInfo.setEndTime(sltAgreementInfo.getOffTime());
|
||||
List<SltAgreementInfo> leaseListOneMonth = getLeaseListOneMonth(agreementInfo, sltAgreementInfo);
|
||||
sltAgreementInfo.setNode(leaseListOneMonth);
|
||||
}
|
||||
leaseList.addAll(monthList);
|
||||
} else {
|
||||
List<SltAgreementInfo> oneOfList = sltAgreementInfoMapper.getLeaseListMonth(bean);
|
||||
for (SltAgreementInfo sltAgreementInfo : oneOfList) {
|
||||
AgreementInfo agreementInfo = new AgreementInfo();
|
||||
agreementInfo.setAgreementId(bean.getAgreementId());
|
||||
agreementInfo.setIds(sltAgreementInfo.getIds());
|
||||
agreementInfo.setCostBearingParty(sltAgreementInfo.getCostBearingParty());
|
||||
agreementInfo.setStartTime(sltAgreementInfo.getBeginTime());
|
||||
sltAgreementInfo.setCodeNum(num++);
|
||||
agreementInfo.setEndTime(sltAgreementInfo.getOffTime());
|
||||
List<SltAgreementInfo> leaseListOneMonth = getLeaseListOneMonth(agreementInfo, sltAgreementInfo);
|
||||
sltAgreementInfo.setNode(leaseListOneMonth);
|
||||
}
|
||||
leaseList.addAll(oneOfList);
|
||||
}
|
||||
// }
|
||||
return leaseList;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ import java.util.List;
|
|||
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.base.api.domain.BackApplyInfo;
|
||||
import com.bonus.sgzb.material.domain.TmTask;
|
||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.sgzb.material.mapper.TaskMapper;
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@ package com.bonus.sgzb.material.service.impl;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.bonus.sgzb.base.api.domain.*;
|
||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
import com.bonus.sgzb.material.mapper.BackRecordMapper;
|
||||
|
|
@ -13,13 +11,11 @@ import com.bonus.sgzb.material.mapper.LeaseRecordMapper;
|
|||
import com.bonus.sgzb.material.mapper.WorkSiteDirectManageMapper;
|
||||
import com.bonus.sgzb.material.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
|
|||
|
|
@ -164,5 +164,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
tta.agreement_id=#{agreementId}
|
||||
</select>
|
||||
<select id="getAllAgreementId" resultType="com.bonus.sgzb.material.domain.AgreementInfo">
|
||||
SELECT
|
||||
agreement_id as agreementId
|
||||
FROM
|
||||
bm_agreement_info
|
||||
WHERE
|
||||
status = '1'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="fileName" column="file_name"/>
|
||||
<result property="fileUrl" column="file_url"/>
|
||||
</resultMap>
|
||||
<insert id="insertTask" keyColumn="task_id" keyProperty="taskId" parameterType="com.bonus.sgzb.material.domain.BackApplyInfo" useGeneratedKeys="true">
|
||||
<insert id="insertTask" keyColumn="task_id" keyProperty="taskId" parameterType="com.bonus.sgzb.base.api.domain.BackApplyInfo" useGeneratedKeys="true">
|
||||
insert into tm_task (
|
||||
<if test="taskType != null">task_type, </if>
|
||||
<if test="taskStatus != null">task_status, </if>
|
||||
|
|
@ -100,7 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertBackApply" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.material.domain.BackApplyInfo" useGeneratedKeys="true">
|
||||
<insert id="insertBackApply" keyColumn="id" keyProperty="id" parameterType="com.bonus.sgzb.base.api.domain.BackApplyInfo" useGeneratedKeys="true">
|
||||
insert into back_apply_info
|
||||
(
|
||||
<if test="code != null">
|
||||
|
|
@ -403,7 +403,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
</delete>
|
||||
|
||||
<select id="getBackApplyList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
<select id="getBackApplyList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id,
|
||||
bai.`code`,
|
||||
|
|
@ -461,7 +461,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ORDER BY bai.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getMaterialList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
<select id="getMaterialList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT subquery1.type_id as typeId,
|
||||
subquery1.typeName typeCode,
|
||||
subquery1.typeNames as typeName,
|
||||
|
|
@ -528,7 +528,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ORDER BY create_time DESC LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getView" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
<select id="getView" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.back_person AS backPerson,
|
||||
bai.phone AS phone,
|
||||
|
|
@ -610,7 +610,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEVEL ASC;
|
||||
</select>
|
||||
|
||||
<select id="exportList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
<select id="exportList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.`code`,
|
||||
bai.back_person as backPerson,
|
||||
|
|
@ -658,7 +658,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
ORDER BY bai.task_id desc
|
||||
</select>
|
||||
<select id="getBackApplyListByAdmin" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
<select id="getBackApplyListByAdmin" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id,
|
||||
bai.`code`,
|
||||
|
|
@ -732,7 +732,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
(SELECT * FROM back_apply_info bai2 WHERE bai2.id = #{id}) dd
|
||||
on bai1.task_id = dd.task_id
|
||||
</select>
|
||||
<select id="getViewByApply" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
<select id="getViewByApply" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.back_person AS backPerson,
|
||||
bai.phone AS phone,
|
||||
|
|
@ -788,7 +788,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
mt.type_name like concat('%', #{keyWord}, '%'))
|
||||
</if>
|
||||
</select>
|
||||
<select id="getBackApplyListByAdmin1" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
<select id="getBackApplyListByAdmin1" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id,
|
||||
bai.`code`,
|
||||
|
|
@ -851,7 +851,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
ORDER BY bai.create_time desc
|
||||
</select>
|
||||
<select id="selectIdByTaskId" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
<select id="selectIdByTaskId" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
select * from back_apply_info where task_id = #{taskId}
|
||||
</select>
|
||||
<select id="getUseNumByTypeId" resultType="java.lang.Integer">
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and bai.agreement_code like concat('%',#{agreementCode},'%')
|
||||
</if>
|
||||
</select>
|
||||
<select id="getAllList" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||
<select id="getAllList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
tta.agreement_id AS agreementId,
|
||||
bai.id,
|
||||
|
|
|
|||
|
|
@ -5,14 +5,72 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="com.bonus.sgzb.material.mapper.CalMonthlyMapper">
|
||||
|
||||
<insert id="insertCalcRecord" parameterType="com.bonus.sgzb.material.domain.CalMonthlyBean" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO calc_project_month (MONTH) VALUES (#{month})
|
||||
INSERT INTO slt_project_month (month,create_time) VALUES (#{month},now())
|
||||
</insert>
|
||||
<insert id="insertProMonCosts" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into project_month_costs(agreement_id,slt_month_id,unit_id,project_id,month,cost_bearing_party)
|
||||
values
|
||||
(#{agreementId},#{sltMonthId},#{unitId},#{projectId},#{month},#{costBearingParty})
|
||||
</insert>
|
||||
<insert id="insertProjectMonthDetail">
|
||||
insert into project_month_detail (type_id,ma_id,unit,start_time,end_time,slt_days,slt_costs,month_temporarily_costs,pro_month_cost_id,num,lease_price)
|
||||
values
|
||||
(#{typeId},#{maId},#{unit},#{startTime},#{endTime},#{sltDays},#{sltCosts},#{monthTemporarilyCosts},#{proMonthCostId},#{num},#{leasePrice})
|
||||
</insert>
|
||||
<update id="updateProMonCosts">
|
||||
update project_month_costs set costs = #{costs} where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="getCalcRecords" parameterType="com.bonus.sgzb.material.domain.CalMonthlyBean" resultType="com.bonus.sgzb.material.domain.CalMonthlyBean">
|
||||
select id,month from calc_project_month
|
||||
where month = #{month}
|
||||
</select>
|
||||
|
||||
<select id="getMonthCosts" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
|
||||
SELECT
|
||||
pmc.id as id,
|
||||
bui.unit_name AS unitName,
|
||||
bp.lot_name AS projectName,
|
||||
spm.month as month,
|
||||
pmc.cost_bearing_party as costBearingParty,
|
||||
pmc.costs as costs
|
||||
FROM
|
||||
project_month_costs pmc
|
||||
LEFT JOIN slt_project_month spm ON pmc.slt_month_id = spm.id
|
||||
LEFT JOIN bm_agreement_info bai ON pmc.agreement_id = bai.agreement_id
|
||||
LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id
|
||||
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
|
||||
WHERE
|
||||
spm.month = DATE_FORMAT(#{endTime}, '%Y-%m')
|
||||
</select>
|
||||
<select id="getMonthDetails" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
|
||||
SELECT
|
||||
mt1.type_name AS typeName,
|
||||
mt.type_name AS modelName,
|
||||
bui.unit_name AS unitName,
|
||||
bp.lot_name AS projectName,
|
||||
mt.unit_name AS nuitName,
|
||||
pmd.num as num,
|
||||
pmc.cost_bearing_party as costBearingParty,
|
||||
pmc.`month` as month,
|
||||
pmd.lease_price as leasePrice,
|
||||
DATE_FORMAT( pmd.start_time, '%Y-%m-%d' ) as startTime,
|
||||
DATE_FORMAT( pmd.end_time, '%Y-%m-%d' ) as endTime,
|
||||
pmd.slt_days as leaseDays,
|
||||
pmd.slt_costs as costs,
|
||||
pmd.month_temporarily_costs as realCosts
|
||||
FROM
|
||||
project_month_detail pmd
|
||||
LEFT JOIN project_month_costs pmc ON pmd.pro_month_cost_id = pmc.id
|
||||
LEFT JOIN bm_unit_info bui ON bui.unit_id = pmc.unit_id
|
||||
LEFT JOIN bm_project_lot bp ON bp.lot_id = pmc.project_id
|
||||
LEFT JOIN ma_type mt ON pmd.type_id = mt.type_id
|
||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||
LEFT JOIN ma_machine mm ON mm.ma_id = pmd.ma_id
|
||||
WHERE
|
||||
pmc.id = #{id}
|
||||
</select>
|
||||
|
||||
<delete id="deleteCalcRecord" parameterType="com.bonus.sgzb.material.domain.CalMonthlyBean">
|
||||
delete from calc_project_month
|
||||
where id = #{id}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue