Merge remote-tracking branch 'origin/master'

highway
wws 1 year ago
commit 33a6a48497

@ -0,0 +1,97 @@
package com.op.device.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.device.domain.EquSpareApply;
import com.op.device.service.IEquSpareApplyService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
/**
* Controller
*
* @author Open Platform
* @date 2023-10-17
*/
@RestController
@RequestMapping("/sparePartsApplicationRecord")
public class EquSpareApplyController extends BaseController {
@Autowired
private IEquSpareApplyService equSpareApplyService;
/**
*
*/
@RequiresPermissions("device:sparePartsApplicationRecord:list")
@GetMapping("/list")
public TableDataInfo list(EquSpareApply equSpareApply) {
startPage();
List<EquSpareApply> list = equSpareApplyService.selectEquSpareApplyList(equSpareApply);
return getDataTable(list);
}
/**
*
*/
@RequiresPermissions("device:sparePartsApplicationRecord:export")
@Log(title = "申领记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EquSpareApply equSpareApply) {
List<EquSpareApply> list = equSpareApplyService.selectEquSpareApplyList(equSpareApply);
ExcelUtil<EquSpareApply> util = new ExcelUtil<EquSpareApply>(EquSpareApply.class);
util.exportExcel(response, list, "申领记录数据");
}
/**
*
*/
@RequiresPermissions("device:sparePartsApplicationRecord:query")
@GetMapping(value = "/{applyId}")
public AjaxResult getInfo(@PathVariable("applyId") String applyId) {
return success(equSpareApplyService.selectEquSpareApplyByApplyId(applyId));
}
/**
*
*/
@RequiresPermissions("device:sparePartsApplicationRecord:add")
@Log(title = "申领记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EquSpareApply equSpareApply) {
return toAjax(equSpareApplyService.insertEquSpareApply(equSpareApply));
}
/**
*
*/
@RequiresPermissions("device:sparePartsApplicationRecord:edit")
@Log(title = "申领记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EquSpareApply equSpareApply) {
return toAjax(equSpareApplyService.updateEquSpareApply(equSpareApply));
}
/**
*
*/
@RequiresPermissions("device:sparePartsApplicationRecord:remove")
@Log(title = "申领记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{applyIds}")
public AjaxResult remove(@PathVariable String[] applyIds) {
return toAjax(equSpareApplyService.deleteEquSpareApplyByApplyIds(applyIds));
}
}

@ -0,0 +1,255 @@
package com.op.device.domain;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity;
/**
* equ_spare_apply
*
* @author Open Platform
* @date 2023-10-17
*/
public class EquSpareApply extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
private String applyId;
/** 出库单号 */
@Excel(name = "出库单号")
private String applyCode;
/** 备品备件编码 */
@Excel(name = "备品备件编码")
private String spareCode;
/** 备品备件名称 */
@Excel(name = "备品备件名称")
private String spareName;
/** 规格型号 */
@Excel(name = "规格型号")
private String spareModel;
/** 数量 */
@Excel(name = "数量")
private Long spareQuantity;
/** 使用组线 */
@Excel(name = "使用组线")
private String spareGroupLine;
/** 使用设备 */
@Excel(name = "使用设备")
private String spareUseEquipment;
/** 领用时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "领用时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyTime;
/** 申领人 */
@Excel(name = "申领人")
private String applyPeople;
/** 批准人 */
@Excel(name = "批准人")
private String applyApprovePeople;
/** 备用字段1 */
@Excel(name = "备用字段1")
private String attr1;
/** 备用字段2 */
@Excel(name = "备用字段2")
private String attr2;
/** 备用字段3 */
@Excel(name = "备用字段3")
private String attr3;
/** 删除标志 */
private String delFlag;
/** 工厂号 */
@Excel(name = "工厂号")
private String factoryCode;
// 创建日期范围list
private List<Date> applyTimeArray;
// 创建日期开始
private String applyTimeStart;
// 创建日期结束
private String applyTimeEnd;
public List<Date> getApplyTimeArray() {
return applyTimeArray;
}
public void setApplyTimeArray(List<Date> applyTimeArray) {
this.applyTimeArray = applyTimeArray;
}
public String getApplyTimeStart() {
return applyTimeStart;
}
public void setApplyTimeStart(String createTimeStart) {
this.applyTimeStart = createTimeStart;
}
public String getApplyTimeEnd() {
return applyTimeEnd;
}
public void setApplyTimeEnd(String applyTimeEnd) {
this.applyTimeEnd = applyTimeEnd;
}
public void setApplyId(String applyId) {
this.applyId = applyId;
}
public String getApplyId() {
return applyId;
}
public void setApplyCode(String applyCode) {
this.applyCode = applyCode;
}
public String getApplyCode() {
return applyCode;
}
public void setSpareCode(String spareCode) {
this.spareCode = spareCode;
}
public String getSpareCode() {
return spareCode;
}
public void setSpareName(String spareName) {
this.spareName = spareName;
}
public String getSpareName() {
return spareName;
}
public void setSpareModel(String spareModel) {
this.spareModel = spareModel;
}
public String getSpareModel() {
return spareModel;
}
public void setSpareQuantity(Long spareQuantity) {
this.spareQuantity = spareQuantity;
}
public Long getSpareQuantity() {
return spareQuantity;
}
public void setSpareGroupLine(String spareGroupLine) {
this.spareGroupLine = spareGroupLine;
}
public String getSpareGroupLine() {
return spareGroupLine;
}
public void setSpareUseEquipment(String spareUseEquipment) {
this.spareUseEquipment = spareUseEquipment;
}
public String getSpareUseEquipment() {
return spareUseEquipment;
}
public void setApplyTime(Date applyTime) {
this.applyTime = applyTime;
}
public Date getApplyTime() {
return applyTime;
}
public void setApplyPeople(String applyPeople) {
this.applyPeople = applyPeople;
}
public String getApplyPeople() {
return applyPeople;
}
public void setApplyApprovePeople(String applyApprovePeople) {
this.applyApprovePeople = applyApprovePeople;
}
public String getApplyApprovePeople() {
return applyApprovePeople;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr1() {
return attr1;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr2() {
return attr2;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr3() {
return attr3;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getDelFlag() {
return delFlag;
}
public void setFactoryCode(String factoryCode) {
this.factoryCode = factoryCode;
}
public String getFactoryCode() {
return factoryCode;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("applyId", getApplyId())
.append("applyCode", getApplyCode())
.append("spareCode", getSpareCode())
.append("spareName", getSpareName())
.append("spareModel", getSpareModel())
.append("spareQuantity", getSpareQuantity())
.append("spareGroupLine", getSpareGroupLine())
.append("spareUseEquipment", getSpareUseEquipment())
.append("applyTime", getApplyTime())
.append("applyPeople", getApplyPeople())
.append("applyApprovePeople", getApplyApprovePeople())
.append("attr1", getAttr1())
.append("attr2", getAttr2())
.append("attr3", getAttr3())
.append("delFlag", getDelFlag())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("factoryCode", getFactoryCode())
.toString();
}
}

@ -0,0 +1,61 @@
package com.op.device.mapper;
import java.util.List;
import com.op.device.domain.EquSpareApply;
/**
* Mapper
*
* @author Open Platform
* @date 2023-10-17
*/
public interface EquSpareApplyMapper {
/**
*
*
* @param applyId
* @return
*/
public EquSpareApply selectEquSpareApplyByApplyId(String applyId);
/**
*
*
* @param equSpareApply
* @return
*/
public List<EquSpareApply> selectEquSpareApplyList(EquSpareApply equSpareApply);
/**
*
*
* @param equSpareApply
* @return
*/
public int insertEquSpareApply(EquSpareApply equSpareApply);
/**
*
*
* @param equSpareApply
* @return
*/
public int updateEquSpareApply(EquSpareApply equSpareApply);
/**
*
*
* @param applyId
* @return
*/
public int deleteEquSpareApplyByApplyId(String applyId);
/**
*
*
* @param applyIds
* @return
*/
public int deleteEquSpareApplyByApplyIds(String[] applyIds);
}

@ -0,0 +1,60 @@
package com.op.device.service;
import java.util.List;
import com.op.device.domain.EquSpareApply;
/**
* Service
*
* @author Open Platform
* @date 2023-10-17
*/
public interface IEquSpareApplyService {
/**
*
*
* @param applyId
* @return
*/
public EquSpareApply selectEquSpareApplyByApplyId(String applyId);
/**
*
*
* @param equSpareApply
* @return
*/
public List<EquSpareApply> selectEquSpareApplyList(EquSpareApply equSpareApply);
/**
*
*
* @param equSpareApply
* @return
*/
public int insertEquSpareApply(EquSpareApply equSpareApply);
/**
*
*
* @param equSpareApply
* @return
*/
public int updateEquSpareApply(EquSpareApply equSpareApply);
/**
*
*
* @param applyIds
* @return
*/
public int deleteEquSpareApplyByApplyIds(String[] applyIds);
/**
*
*
* @param applyId
* @return
*/
public int deleteEquSpareApplyByApplyId(String applyId);
}

@ -0,0 +1,111 @@
package com.op.device.service.impl;
import java.text.SimpleDateFormat;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.device.mapper.EquSpareApplyMapper;
import com.op.device.domain.EquSpareApply;
import com.op.device.service.IEquSpareApplyService;
/**
* Service
*
* @author Open Platform
* @date 2023-10-17
*/
@Service
public class EquSpareApplyServiceImpl implements IEquSpareApplyService {
@Autowired
private EquSpareApplyMapper equSpareApplyMapper;
/**
*
*
* @param applyId
* @return
*/
@Override
@DS("#header.poolName")
public EquSpareApply selectEquSpareApplyByApplyId(String applyId) {
return equSpareApplyMapper.selectEquSpareApplyByApplyId(applyId);
}
/**
*
*
* @param equSpareApply
* @return
*/
@Override
@DS("#header.poolName")
public List<EquSpareApply> selectEquSpareApplyList(EquSpareApply equSpareApply) {
if (equSpareApply.getApplyTimeArray() != null) {
// 设置创建日期开始和结束值
if (equSpareApply.getApplyTimeArray().size() == 2) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
equSpareApply.setApplyTimeStart(formatter.format(equSpareApply.getApplyTimeArray().get(0)));
equSpareApply.setApplyTimeEnd(formatter.format(equSpareApply.getApplyTimeArray().get(1)));
}
}
return equSpareApplyMapper.selectEquSpareApplyList(equSpareApply);
}
/**
*
*
* @param equSpareApply
* @return
*/
@Override
@DS("#header.poolName")
public int insertEquSpareApply(EquSpareApply equSpareApply) {
equSpareApply.setApplyId(IdUtils.fastSimpleUUID());
equSpareApply.setCreateTime(DateUtils.getNowDate());
equSpareApply.setCreateBy(SecurityUtils.getUsername());
return equSpareApplyMapper.insertEquSpareApply(equSpareApply);
}
/**
*
*
* @param equSpareApply
* @return
*/
@Override
@DS("#header.poolName")
public int updateEquSpareApply(EquSpareApply equSpareApply) {
equSpareApply.setUpdateTime(DateUtils.getNowDate());
equSpareApply.setUpdateBy(SecurityUtils.getUsername());
return equSpareApplyMapper.updateEquSpareApply(equSpareApply);
}
/**
*
*
* @param applyIds
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquSpareApplyByApplyIds(String[] applyIds) {
return equSpareApplyMapper.deleteEquSpareApplyByApplyIds(applyIds);
}
/**
*
*
* @param applyId
* @return
*/
@Override
@DS("#header.poolName")
public int deleteEquSpareApplyByApplyId(String applyId) {
return equSpareApplyMapper.deleteEquSpareApplyByApplyId(applyId);
}
}

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.op.device.mapper.EquSpareApplyMapper">
<resultMap type="EquSpareApply" id="EquSpareApplyResult">
<result property="applyId" column="apply_id" />
<result property="applyCode" column="apply_code" />
<result property="spareCode" column="spare_code" />
<result property="spareName" column="spare_name" />
<result property="spareModel" column="spare_model" />
<result property="spareQuantity" column="spare_quantity" />
<result property="spareGroupLine" column="spare_group_line" />
<result property="spareUseEquipment" column="spare_use_equipment" />
<result property="applyTime" column="apply_time" />
<result property="applyPeople" column="apply_people" />
<result property="applyApprovePeople" column="apply_approve_people" />
<result property="attr1" column="attr1" />
<result property="attr2" column="attr2" />
<result property="attr3" column="attr3" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="factoryCode" column="factory_code" />
</resultMap>
<sql id="selectEquSpareApplyVo">
select apply_id, apply_code, spare_code, spare_name, spare_model, spare_quantity, spare_group_line, spare_use_equipment, apply_time, apply_people, apply_approve_people, attr1, attr2, attr3, del_flag, create_by, create_time, update_by, update_time, factory_code from equ_spare_apply
</sql>
<select id="selectEquSpareApplyList" parameterType="EquSpareApply" resultMap="EquSpareApplyResult">
<include refid="selectEquSpareApplyVo"/>
<where>
<if test="applyCode != null and applyCode != ''"> and apply_code like concat('%', #{applyCode}, '%')</if>
<if test="spareCode != null and spareCode != ''"> and spare_code like concat('%', #{spareCode}, '%')</if>
<if test="spareName != null and spareName != ''"> and spare_name like concat('%', #{spareName}, '%')</if>
<if test="spareModel != null and spareModel != ''"> and spare_model like concat('%', #{spareModel}, '%')</if>
<if test="spareQuantity != null "> and spare_quantity like concat('%', #{spareQuantity}, '%')</if>
<if test="spareGroupLine != null and spareGroupLine != ''"> and spare_group_line like concat('%', #{spareGroupLine}, '%')</if>
<if test="spareUseEquipment != null and spareUseEquipment != ''"> and spare_use_equipment like concat('%', #{spareUseEquipment}, '%')</if>
<if test="applyTimeStart != null "> and CONVERT(date,apply_time) >= #{applyTimeStart}</if>
<if test="applyTimeEnd != null "> and #{applyTimeEnd} >= CONVERT(date,apply_time)</if>
<if test="applyPeople != null and applyPeople != ''"> and apply_people like concat('%', #{applyPeople}, '%')</if>
<if test="applyApprovePeople != null and applyApprovePeople != ''"> and apply_approve_people like concat('%', #{applyApprovePeople}, '%')</if>
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
and del_flag = '0'
ORDER BY apply_time DESC
</where>
</select>
<select id="selectEquSpareApplyByApplyId" parameterType="String" resultMap="EquSpareApplyResult">
<include refid="selectEquSpareApplyVo"/>
where apply_id = #{applyId}
and del_flag = '0'
</select>
<insert id="insertEquSpareApply" parameterType="EquSpareApply">
insert into equ_spare_apply
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="applyId != null">apply_id,</if>
<if test="applyCode != null">apply_code,</if>
<if test="spareCode != null">spare_code,</if>
<if test="spareName != null">spare_name,</if>
<if test="spareModel != null">spare_model,</if>
<if test="spareQuantity != null">spare_quantity,</if>
<if test="spareGroupLine != null">spare_group_line,</if>
<if test="spareUseEquipment != null">spare_use_equipment,</if>
<if test="applyTime != null">apply_time,</if>
<if test="applyPeople != null">apply_people,</if>
<if test="applyApprovePeople != null">apply_approve_people,</if>
<if test="attr1 != null">attr1,</if>
<if test="attr2 != null">attr2,</if>
<if test="attr3 != null">attr3,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="factoryCode != null">factory_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="applyId != null">#{applyId},</if>
<if test="applyCode != null">#{applyCode},</if>
<if test="spareCode != null">#{spareCode},</if>
<if test="spareName != null">#{spareName},</if>
<if test="spareModel != null">#{spareModel},</if>
<if test="spareQuantity != null">#{spareQuantity},</if>
<if test="spareGroupLine != null">#{spareGroupLine},</if>
<if test="spareUseEquipment != null">#{spareUseEquipment},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="applyPeople != null">#{applyPeople},</if>
<if test="applyApprovePeople != null">#{applyApprovePeople},</if>
<if test="attr1 != null">#{attr1},</if>
<if test="attr2 != null">#{attr2},</if>
<if test="attr3 != null">#{attr3},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
</trim>
</insert>
<update id="updateEquSpareApply" parameterType="EquSpareApply">
update equ_spare_apply
<trim prefix="SET" suffixOverrides=",">
<if test="applyCode != null">apply_code = #{applyCode},</if>
<if test="spareCode != null">spare_code = #{spareCode},</if>
<if test="spareName != null">spare_name = #{spareName},</if>
<if test="spareModel != null">spare_model = #{spareModel},</if>
<if test="spareQuantity != null">spare_quantity = #{spareQuantity},</if>
<if test="spareGroupLine != null">spare_group_line = #{spareGroupLine},</if>
<if test="spareUseEquipment != null">spare_use_equipment = #{spareUseEquipment},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="applyPeople != null">apply_people = #{applyPeople},</if>
<if test="applyApprovePeople != null">apply_approve_people = #{applyApprovePeople},</if>
<if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if>
<if test="attr3 != null">attr3 = #{attr3},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
</trim>
where apply_id = #{applyId}
</update>
<delete id="deleteEquSpareApplyByApplyId" parameterType="String">
delete from equ_spare_apply where apply_id = #{applyId}
</delete>
<delete id="deleteEquSpareApplyByApplyIds" parameterType="String">
delete from equ_spare_apply where apply_id in
<foreach item="applyId" collection="array" open="(" separator="," close=")">
#{applyId}
</foreach>
</delete>
</mapper>

@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -81,8 +82,12 @@ public class SapController extends BaseController {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++product同步开始++++++++++");
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
Date maxTime = sapBomMapper.getProductMaxTime();
if(maxTime != null){
Date maxTime0 = sapBomMapper.getProductMaxTime();
if(maxTime0 != null){
Calendar calendar = Calendar.getInstance();
calendar.setTime(maxTime0);
calendar.add(Calendar.DAY_OF_YEAR, 1);
Date maxTime = calendar.getTime();
qo.setLaeda(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
}
@ -113,8 +118,12 @@ public class SapController extends BaseController {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++bom同步开始++++++++++");
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
Date maxTime = sapBomMapper.getProductMaxTime();
if(maxTime != null){
Date maxTime0 = sapBomMapper.getProductMaxTime();
if(maxTime0 != null){
Calendar calendar = Calendar.getInstance();
calendar.setTime(maxTime0);
calendar.add(Calendar.DAY_OF_YEAR, 1);
Date maxTime = calendar.getTime();
qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
}
@ -131,7 +140,6 @@ public class SapController extends BaseController {
/**
* 线
* @param SapRouterQuery qo
* @return
*/
@PostMapping("/sapRouterSync")
@ -147,8 +155,12 @@ public class SapController extends BaseController {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++工艺同步开始++++++++++");
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
Date maxTime = sapBomMapper.getRouteMaxTime();
if(maxTime != null){
Date maxTime0 = sapBomMapper.getRouteMaxTime();
if(maxTime0 != null){
Calendar calendar = Calendar.getInstance();
calendar.setTime(maxTime0);
calendar.add(Calendar.DAY_OF_YEAR, 1);
Date maxTime = calendar.getTime();
qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
}
qo.setWerks(dateSource.get("poolName").replace("ds_",""));//工厂
@ -227,8 +239,12 @@ public class SapController extends BaseController {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++工作中心开始++++++++++");
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
qo.setWerks(dateSource.get("poolName").replace("ds_",""));//工厂
Date maxTime = sapBomMapper.getMaxTime();
if(maxTime != null){
Date maxTime0 = sapBomMapper.getMaxTime();
if(maxTime0 != null){
Calendar calendar = Calendar.getInstance();
calendar.setTime(maxTime0);
calendar.add(Calendar.DAY_OF_YEAR, 1);
Date maxTime = calendar.getTime();
qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
}
@ -263,8 +279,12 @@ public class SapController extends BaseController {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++供应商主数据开始++++++++++");
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
sapSupplierQuery.setBukrs(dateSource.get("poolName").replace("ds_",""));//工厂
Date maxTime = sapBomMapper.getSupplierMaxTime();
if(maxTime != null){
Date maxTime0 = sapBomMapper.getSupplierMaxTime();
if(maxTime0 != null){
Calendar calendar = Calendar.getInstance();
calendar.setTime(maxTime0);
calendar.add(Calendar.DAY_OF_YEAR, 1);
Date maxTime = calendar.getTime();
sapSupplierQuery.setErdat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
}
@ -301,8 +321,13 @@ public class SapController extends BaseController {
logger.info("++++++++++++" + dateSource.get("poolName") + "++++客户主数据开始++++++++++");
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
sapCustom.setBukrs(dateSource.get("poolName").replace("ds_",""));//工厂
Date maxTime = sapBomMapper.getCustomMaxTime();
if(maxTime != null){
Date maxTime0 = sapBomMapper.getCustomMaxTime();
if(maxTime0 != null){
Calendar calendar = Calendar.getInstance();
calendar.setTime(maxTime0);
calendar.add(Calendar.DAY_OF_YEAR, 1);
Date maxTime = calendar.getTime();
sapCustom.setErdat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
}

Loading…
Cancel
Save