Browse Source

成本改动

java8
wenkuan.shi 2 years ago
parent
commit
5288b7ad97
  1. 16
      src/main/java/com/xujie/sys/common/utils/TaskUtils.java
  2. 5
      src/main/java/com/xujie/sys/modules/fanuc/dao/CostMapper.java
  3. 5
      src/main/java/com/xujie/sys/modules/fanuc/dao/LaborClassCostMapper.java
  4. 1
      src/main/java/com/xujie/sys/modules/fanuc/entity/CostEntity.java
  5. 38
      src/main/resources/mapper/fanuc/CostMapper.xml
  6. 32
      src/main/resources/mapper/fanuc/LaborClassCostMapper.xml

16
src/main/java/com/xujie/sys/common/utils/TaskUtils.java

@ -38,10 +38,10 @@ public class TaskUtils {
}
// 添加定時任務
@Scheduled(cron = "${task.data.getExcelInformation}" ) //每五秒执行 读取文件数据
public void getExcel(){
getInformationForExcelService.saveByExcel();
}
// @Scheduled(cron = "${task.data.getExcelInformation}" ) //每五秒执行 读取文件数据
// public void getExcel(){
// getInformationForExcelService.saveByExcel();
// }
// 添加未上传文件邮件通知定時任務
@Scheduled(cron = "${task.data.sendEmail}" )
@ -50,10 +50,10 @@ public class TaskUtils {
}
//添加定時任務
@Scheduled(cron = "${task.data.modbusCommunicate}" ) //每五秒执行 读取文件数据
public void getModbus(){
modbusCommunicateService.getInfoByModbus();
}
// @Scheduled(cron = "${task.data.modbusCommunicate}" ) //每五秒执行 读取文件数据
// public void getModbus(){
// modbusCommunicateService.getInfoByModbus();
// }
}

5
src/main/java/com/xujie/sys/modules/fanuc/dao/CostMapper.java

@ -3,11 +3,10 @@ package com.xujie.sys.modules.fanuc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xujie.sys.modules.fanuc.entity.CostEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface CostMapper extends BaseMapper<CostEntity> {
void updateByEntity(@Param("costEntity") CostEntity costEntity);
void updateByEntity(CostEntity costEntity);
void deleteByEntity(@Param("costEntity") CostEntity costEntity);
void deleteByEntity(CostEntity costEntity);
}

5
src/main/java/com/xujie/sys/modules/fanuc/dao/LaborClassCostMapper.java

@ -3,11 +3,10 @@ package com.xujie.sys.modules.fanuc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xujie.sys.modules.fanuc.entity.LaborClassCostEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface LaborClassCostMapper extends BaseMapper<LaborClassCostEntity> {
void updateByEntity(@Param("laborClassCostEntity") LaborClassCostEntity laborClassCostEntity);
void updateByEntity( LaborClassCostEntity laborClassCostEntity);
void removeByEntity(@Param("laborClassCostEntity")LaborClassCostEntity laborClassCostEntity);
void removeByEntity(LaborClassCostEntity laborClassCostEntity);
}

1
src/main/java/com/xujie/sys/modules/fanuc/entity/CostEntity.java

@ -34,4 +34,5 @@ public class CostEntity extends QueryPage implements Serializable {
private Date endDate;
//备注
private String remark;
}

38
src/main/resources/mapper/fanuc/CostMapper.xml

@ -1,29 +1,39 @@
<?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.xujie.sys.modules.fanuc.dao.CostMapper">
<resultMap id="BaseResultMap" type="com.xujie.sys.modules.fanuc.entity.CostEntity">
<result column="site" jdbcType="VARCHAR" property="site" />
<result column="item_no" jdbcType="VARCHAR" property="itemNo" />
<result column="work_center_no" jdbcType="VARCHAR" property="workCenterNo" />
<result column="unit_cost" jdbcType="DOUBLE" property="unitCost" />
<result column="overhead_cost" jdbcType="DOUBLE" property="overheadCost" />
<result column="labor_cost" jdbcType="DOUBLE" property="laborCost" />
<result column="um_id" jdbcType="VARCHAR" property="umId" />
<result column="begin_date" jdbcType="DATE" property="beginDate" />
<result column="end_date" jdbcType="DATE" property="endDate" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<update id="updateByEntity">
<update id="updateByEntity" parameterType="com.xujie.sys.modules.fanuc.entity.CostEntity" >
UPDATE Work_Center_Cost
SET
<if test="costEntity.itemNo != null and costEntity.itemNo != ''">item_no = #{itemNo},</if>
<if test="costEntity.unitCost != null and costEntity.unitCost != ''">unit_cost = #{unitCost},</if>
<if test="costEntity.overheadCost != null and costEntity.overheadCost != ''">overhead_cost = #{overheadCost},
</if>
<if test="costEntity.laborCost != null and costEntity.laborCost != ''">labor_cost = #{laborCost},</if>
<if test="costEntity.umId != null and costEntity.umId != ''">um_id = #{umId},</if>
<if test="costEntity.beginDate != null ">begin_date = #{beginDate},</if>
<if test="costEntity.endDate != null ">end_date = #{endDate},</if>
<if test="costEntity.remark != null and costEntity.remark != ''">remark = #{remark}</if>
<set>
<if test="unitCost != null ">unit_cost = #{unitCost},</if>
<if test="overheadCost != null ">overhead_cost = #{overheadCost},</if>
<if test="laborCost != null ">labor_cost = #{laborCost},</if>
<if test="umId != null and costEntity.umId != ''">um_id = #{umId},</if>
<if test="beginDate != null ">begin_date = #{beginDate},</if>
<if test="endDate != null ">end_date = #{endDate},</if>
<if test="remark != null and remark != ''">remark = #{remark}</if>
</set>
WHERE site = #{site}
And work_center_no=#{workCenterNo}
And item_no=#{itemNo}
</update>
<delete id="deleteByEntity">
<delete id="deleteByEntity" parameterType="CostEntity">
Delete
from labor_class_cost
from Work_Center_Cost
WHERE site = #{site}
And work_center_no = #{workCenterNo}
And item_no = #{itemNo}

32
src/main/resources/mapper/fanuc/LaborClassCostMapper.xml

@ -3,28 +3,28 @@
<mapper namespace="com.xujie.sys.modules.fanuc.dao.LaborClassCostMapper">
<update id="updateByEntity">
<update id="updateByEntity" parameterType="com.xujie.sys.modules.fanuc.entity.LaborClassCostEntity">
UPDATE labor_class_cost
SET
<if test="laborClassCostEntity.itemNo != null and laborClassCostEntity.itemNo != ''">item_no = #{itemNo},</if>
<if test="laborClassCostEntity.unitCost != null and laborClassCostEntity.unitCost != ''">unit_cost =
#{unitCost},
</if>
<if test="laborClassCostEntity.overheadCost != null and laborClassCostEntity.overheadCost != ''">overhead_cost =
#{overheadCost},
</if>
<if test="laborClassCostEntity.umId != null and laborClassCostEntity.umId != ''">um_id = #{umId},</if>
<if test="laborClassCostEntity.beginDate != null ">begin_date =#{beginDate},
</if>
<if test="laborClassCostEntity.endDate != null ">end_date = #{endDate},
</if>
<if test="laborClassCostEntity.remark != null and laborClassCostEntity.remark != ''">remark = #{remark}</if>
<set>
<if test="unitCost != null ">unit_cost =
#{unitCost},
</if>
<if test="overheadCost != null ">overhead_cost =
#{overheadCost},
</if>
<if test="umId != null and umId != ''">um_id = #{umId},</if>
<if test="beginDate != null ">begin_date =#{beginDate},
</if>
<if test="endDate != null ">end_date = #{endDate},
</if>
<if test="remark != null and remark != ''">remark = #{remark}</if>
</set>
WHERE site = #{site}
And class_no=#{classNo}
And item_no=#{itemNo}
</update>
<delete id="removeByEntity">
<delete id="removeByEntity" parameterType="com.xujie.sys.modules.fanuc.entity.LaborClassCostEntity">
Delete
from labor_class_cost
WHERE site = #{site}

Loading…
Cancel
Save