Merge branch 'master' of https://gitee.com/kutangguo/ktg-mes
This commit is contained in:
@@ -134,7 +134,7 @@ public class CalTeamshiftServiceImpl implements ICalTeamshiftService
|
||||
CalPlanTeam p2 = new CalPlanTeam();
|
||||
p2.setPlanId(plandId);
|
||||
List<CalPlanTeam> teams = calPlanTeamMapper.selectCalPlanTeamList(p2);
|
||||
Long days = CalendarUtil.getDateDiff(plan.getStartDate(),plan.getEndDate());
|
||||
Long days = CalendarUtil.getDateDiff(plan.getStartDate(),plan.getEndDate()) + 1;
|
||||
|
||||
int shiftIndex =0;
|
||||
Date nowDate =null;
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
import com.ktg.common.core.domain.AjaxResult;
|
||||
import com.ktg.common.core.domain.entity.SysUser;
|
||||
import com.ktg.common.core.page.TableDataInfo;
|
||||
import com.ktg.common.enums.BusinessType;
|
||||
import com.ktg.common.utils.SecurityUtils;
|
||||
@@ -21,7 +22,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备Controller
|
||||
*
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
@@ -117,4 +118,11 @@ public class DvMachineryController extends BaseController
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response)
|
||||
{
|
||||
ExcelUtil<DvMachinery> util = new ExcelUtil<DvMachinery>(DvMachinery.class);
|
||||
util.importTemplateExcel(response, "设备台账");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,19 +13,19 @@ import com.ktg.mes.dv.service.IDvSubjectService;
|
||||
|
||||
/**
|
||||
* 设备点检保养项目Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@Service
|
||||
public class DvSubjectServiceImpl implements IDvSubjectService
|
||||
public class DvSubjectServiceImpl implements IDvSubjectService
|
||||
{
|
||||
@Autowired
|
||||
private DvSubjectMapper dvSubjectMapper;
|
||||
|
||||
/**
|
||||
* 查询设备点检保养项目
|
||||
*
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 设备点检保养项目
|
||||
*/
|
||||
@@ -37,7 +37,7 @@ public class DvSubjectServiceImpl implements IDvSubjectService
|
||||
|
||||
/**
|
||||
* 查询设备点检保养项目列表
|
||||
*
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 设备点检保养项目
|
||||
*/
|
||||
@@ -51,7 +51,7 @@ public class DvSubjectServiceImpl implements IDvSubjectService
|
||||
public String checkSubjectCodeUnique(DvSubject dvSubject) {
|
||||
DvSubject subject = dvSubjectMapper.checkSubjectCodeUnique(dvSubject);
|
||||
Long subjectId = dvSubject.getSubjectId()==null?-1L:dvSubject.getSubjectId();
|
||||
if(StringUtils.isNotNull(subject) && subject.getSubjectId().longValue() == subjectId.longValue()){
|
||||
if(StringUtils.isNotNull(subject) && subject.getSubjectId().longValue() != subjectId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@@ -59,7 +59,7 @@ public class DvSubjectServiceImpl implements IDvSubjectService
|
||||
|
||||
/**
|
||||
* 新增设备点检保养项目
|
||||
*
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ public class DvSubjectServiceImpl implements IDvSubjectService
|
||||
|
||||
/**
|
||||
* 修改设备点检保养项目
|
||||
*
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -85,7 +85,7 @@ public class DvSubjectServiceImpl implements IDvSubjectService
|
||||
|
||||
/**
|
||||
* 批量删除设备点检保养项目
|
||||
*
|
||||
*
|
||||
* @param subjectIds 需要删除的设备点检保养项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -97,7 +97,7 @@ public class DvSubjectServiceImpl implements IDvSubjectService
|
||||
|
||||
/**
|
||||
* 删除设备点检保养项目信息
|
||||
*
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ktg.mes.md.controller;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.mes.md.service.IMdUnitMeasureService;
|
||||
import com.ktg.common.annotation.Log;
|
||||
import com.ktg.common.core.controller.BaseController;
|
||||
@@ -17,7 +18,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 单位Controller
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-27
|
||||
*/
|
||||
@@ -86,6 +87,9 @@ public class MdUnitMeasureController extends BaseController
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MdUnitMeasure mdUnitMeasure)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdUnitMeasureService.checkMeasureUnitCodeUnique(mdUnitMeasure))){
|
||||
return AjaxResult.error("单位编码已存在!");
|
||||
}
|
||||
return toAjax(mdUnitMeasureService.insertMdUnitMeasure(mdUnitMeasure));
|
||||
}
|
||||
|
||||
@@ -97,6 +101,9 @@ public class MdUnitMeasureController extends BaseController
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MdUnitMeasure mdUnitMeasure)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(mdUnitMeasureService.checkMeasureUnitCodeUnique(mdUnitMeasure))){
|
||||
return AjaxResult.error("单位编码已存在!");
|
||||
}
|
||||
return toAjax(mdUnitMeasureService.updateMdUnitMeasure(mdUnitMeasure));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,23 +6,30 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 单位Mapper接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-27
|
||||
*/
|
||||
public interface MdUnitMeasureMapper
|
||||
public interface MdUnitMeasureMapper
|
||||
{
|
||||
/**
|
||||
* 查询单位
|
||||
*
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 单位
|
||||
*/
|
||||
public MdUnitMeasure selectMdUnitMeasureByMeasureId(Long measureId);
|
||||
/**
|
||||
* 计量单位唯一校验
|
||||
*
|
||||
* @param mdUnitMeasure 单位主键
|
||||
* @return 单位
|
||||
*/
|
||||
public MdUnitMeasure checkMeasureUnitCodeUnique(MdUnitMeasure mdUnitMeasure);
|
||||
|
||||
/**
|
||||
* 查询单位列表
|
||||
*
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 单位集合
|
||||
*/
|
||||
@@ -32,7 +39,7 @@ public interface MdUnitMeasureMapper
|
||||
|
||||
/**
|
||||
* 新增单位
|
||||
*
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -40,7 +47,7 @@ public interface MdUnitMeasureMapper
|
||||
|
||||
/**
|
||||
* 修改单位
|
||||
*
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -48,7 +55,7 @@ public interface MdUnitMeasureMapper
|
||||
|
||||
/**
|
||||
* 删除单位
|
||||
*
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -56,7 +63,7 @@ public interface MdUnitMeasureMapper
|
||||
|
||||
/**
|
||||
* 批量删除单位
|
||||
*
|
||||
*
|
||||
* @param measureIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@@ -6,23 +6,30 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 单位Service接口
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-27
|
||||
*/
|
||||
public interface IMdUnitMeasureService
|
||||
public interface IMdUnitMeasureService
|
||||
{
|
||||
/**
|
||||
* 查询单位
|
||||
*
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 单位
|
||||
*/
|
||||
public MdUnitMeasure selectMdUnitMeasureByMeasureId(Long measureId);
|
||||
/**
|
||||
* 计量单位唯一校验
|
||||
*
|
||||
* @param mdUnitMeasure 单位主键
|
||||
* @return 单位
|
||||
*/
|
||||
public String checkMeasureUnitCodeUnique(MdUnitMeasure mdUnitMeasure);
|
||||
|
||||
/**
|
||||
* 查询单位列表
|
||||
*
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 单位集合
|
||||
*/
|
||||
@@ -37,7 +44,7 @@ public interface IMdUnitMeasureService
|
||||
|
||||
/**
|
||||
* 新增单位
|
||||
*
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -45,7 +52,7 @@ public interface IMdUnitMeasureService
|
||||
|
||||
/**
|
||||
* 修改单位
|
||||
*
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -53,7 +60,7 @@ public interface IMdUnitMeasureService
|
||||
|
||||
/**
|
||||
* 批量删除单位
|
||||
*
|
||||
*
|
||||
* @param measureIds 需要删除的单位主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -61,7 +68,7 @@ public interface IMdUnitMeasureService
|
||||
|
||||
/**
|
||||
* 删除单位信息
|
||||
*
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,9 @@ package com.ktg.mes.md.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ktg.common.constant.UserConstants;
|
||||
import com.ktg.common.utils.StringUtils;
|
||||
import com.ktg.mes.md.domain.MdClient;
|
||||
import com.ktg.mes.md.service.IMdUnitMeasureService;
|
||||
import com.ktg.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -11,7 +14,7 @@ import com.ktg.mes.md.domain.MdUnitMeasure;
|
||||
|
||||
/**
|
||||
* 单位Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2022-04-27
|
||||
*/
|
||||
@@ -23,7 +26,7 @@ public class MdUnitMeasureServiceImpl implements IMdUnitMeasureService
|
||||
|
||||
/**
|
||||
* 查询单位
|
||||
*
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 单位
|
||||
*/
|
||||
@@ -33,9 +36,19 @@ public class MdUnitMeasureServiceImpl implements IMdUnitMeasureService
|
||||
return mdUnitMeasureMapper.selectMdUnitMeasureByMeasureId(measureId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkMeasureUnitCodeUnique(MdUnitMeasure mdUnitMeasure) {
|
||||
MdUnitMeasure unitMeasure = mdUnitMeasureMapper.checkMeasureUnitCodeUnique(mdUnitMeasure);
|
||||
Long subjectId = mdUnitMeasure.getMeasureId()==null?-1L:mdUnitMeasure.getMeasureId();
|
||||
if(StringUtils.isNotNull(unitMeasure)&& unitMeasure.getMeasureId().longValue() != subjectId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询单位列表
|
||||
*
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 单位
|
||||
*/
|
||||
@@ -52,7 +65,7 @@ public class MdUnitMeasureServiceImpl implements IMdUnitMeasureService
|
||||
|
||||
/**
|
||||
* 新增单位
|
||||
*
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -65,7 +78,7 @@ public class MdUnitMeasureServiceImpl implements IMdUnitMeasureService
|
||||
|
||||
/**
|
||||
* 修改单位
|
||||
*
|
||||
*
|
||||
* @param mdUnitMeasure 单位
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -78,7 +91,7 @@ public class MdUnitMeasureServiceImpl implements IMdUnitMeasureService
|
||||
|
||||
/**
|
||||
* 批量删除单位
|
||||
*
|
||||
*
|
||||
* @param measureIds 需要删除的单位主键
|
||||
* @return 结果
|
||||
*/
|
||||
@@ -90,7 +103,7 @@ public class MdUnitMeasureServiceImpl implements IMdUnitMeasureService
|
||||
|
||||
/**
|
||||
* 删除单位信息
|
||||
*
|
||||
*
|
||||
* @param measureId 单位主键
|
||||
* @return 结果
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ktg.mes.md.mapper.MdUnitMeasureMapper">
|
||||
|
||||
|
||||
<resultMap type="MdUnitMeasure" id="MdUnitMeasureResult">
|
||||
<result property="measureId" column="measure_id" />
|
||||
<result property="measureCode" column="measure_code" />
|
||||
@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectMdUnitMeasureList" parameterType="MdUnitMeasure" resultMap="MdUnitMeasureResult">
|
||||
<include refid="selectMdUnitMeasureVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="measureCode != null and measureCode != ''"> and measure_code = #{measureCode}</if>
|
||||
<if test="measureName != null and measureName != ''"> and measure_name like concat('%', #{measureName}, '%')</if>
|
||||
<if test="primaryFlag != null and primaryFlag != ''"> and primary_flag = #{primaryFlag}</if>
|
||||
@@ -42,7 +42,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="attr4 != null "> and attr4 = #{attr4}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="checkMeasureUnitCodeUnique" parameterType="MdUnitMeasure" resultMap="MdUnitMeasureResult">
|
||||
<include refid="selectMdUnitMeasureVo"/>
|
||||
where measure_code = #{measureCode} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectMdUnitMeasureByMeasureId" parameterType="Long" resultMap="MdUnitMeasureResult">
|
||||
<include refid="selectMdUnitMeasureVo"/>
|
||||
where measure_id = #{measureId}
|
||||
@@ -118,9 +123,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMdUnitMeasureByMeasureIds" parameterType="String">
|
||||
delete from md_unit_measure where measure_id in
|
||||
delete from md_unit_measure where measure_id in
|
||||
<foreach item="measureId" collection="array" open="(" separator="," close=")">
|
||||
#{measureId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user