设备维修,员工显示名称、不良代码显示名称

master
zpl 3 years ago
parent aaed4b87c6
commit f5fade663b

@ -235,7 +235,7 @@ public class ResourceInspectTaskController {
try { try {
return R.ok(resourceInspectTaskService.getInspectTaskByResource(resourceInspectTaskDto)); return R.ok(resourceInspectTaskService.getInspectTaskByResource(resourceInspectTaskDto));
}catch (Exception e){ }catch (Exception e){
return R.failed("数据更新失败" + e.getMessage()); return R.failed("查询失败:" + e.getMessage());
} }
} }

@ -26,6 +26,21 @@ public class ResourceRepairTaskController {
@Autowired @Autowired
public ResourceRepairTaskService resourceRepairTaskService; public ResourceRepairTaskService resourceRepairTaskService;
/**
*
* @param
* @return
*/
@GetMapping("/init")
public R init(){
try{
return R.ok(resourceRepairTaskService.init());
}catch (Exception e){
return R.failed("" + e.getMessage());
}
}
/** /**
* id * id
* *
@ -271,5 +286,4 @@ public class ResourceRepairTaskController {
} }
} }

@ -282,29 +282,19 @@ public class ResourceRepairTask extends Model<ResourceRepairTask> {
*/ */
@TableField(exist = false) @TableField(exist = false)
private String compareStartDate; private String compareStartDate;
/** /**比较时间,终*/
*
*/
@TableField(exist = false) @TableField(exist = false)
private String compareEndDate; private String compareEndDate;
/** /**备品清单*/
*
*/
@TableField(exist = false) @TableField(exist = false)
private List<ResourceInspectTaskSpare> spareList; private List<ResourceInspectTaskSpare> spareList;
/** /**序号*/
*
*/
@TableField(exist = false) @TableField(exist = false)
private Integer seq; private Integer seq;
/** /**提报人名称*/
*
*/
@TableField(exist = false) @TableField(exist = false)
private String reportUserName; private String reportUserName;
/** /**取消代码描述*/
*
*/
@TableField(exist = false) @TableField(exist = false)
private String cancelCodeDescription; private String cancelCodeDescription;
/**取消用户名称**/ /**取消用户名称**/
@ -313,6 +303,18 @@ public class ResourceRepairTask extends Model<ResourceRepairTask> {
/**不良代码名称**/ /**不良代码名称**/
@TableField(exist = false) @TableField(exist = false)
private String ncCodeNoDescription; private String ncCodeNoDescription;
/**维修人员名称*/
@TableField(exist = false)
private String repairUserName;
public String getRepairUserName() {
return repairUserName;
}
public void setRepairUserName(String repairUserName) {
this.repairUserName = repairUserName;
}
public String getNcCodeNoDescription() { public String getNcCodeNoDescription() {
return ncCodeNoDescription; return ncCodeNoDescription;

@ -5,6 +5,7 @@ import com.foreverwin.mesnac.equip.model.ResourceRepairTask;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.foreverwin.modular.core.util.FrontPage; import com.foreverwin.modular.core.util.FrontPage;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -17,6 +18,8 @@ import java.util.List;
*/ */
public interface ResourceRepairTaskService extends IService<ResourceRepairTask> { public interface ResourceRepairTaskService extends IService<ResourceRepairTask> {
HashMap<String,Object> init();
/** /**
* *
* @param frontPage * @param frontPage

@ -6,7 +6,10 @@ import com.foreverwin.mesnac.common.helper.NextNumberHelper;
import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare; import com.foreverwin.mesnac.equip.model.ResourceInspectTaskSpare;
import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService; import com.foreverwin.mesnac.equip.service.ResourceInspectTaskSpareService;
import com.foreverwin.mesnac.meapi.dto.NcCodeDto; import com.foreverwin.mesnac.meapi.dto.NcCodeDto;
import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper;
import com.foreverwin.mesnac.meapi.model.DataField;
import com.foreverwin.mesnac.meapi.model.NwaUser; import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.service.DataFieldListService;
import com.foreverwin.mesnac.meapi.service.NcCodeService; import com.foreverwin.mesnac.meapi.service.NcCodeService;
import com.foreverwin.mesnac.meapi.service.NwaUserService; import com.foreverwin.mesnac.meapi.service.NwaUserService;
import com.foreverwin.mesnac.meapi.service.ResrceService; import com.foreverwin.mesnac.meapi.service.ResrceService;
@ -53,6 +56,23 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
private ResrceService resrceService; private ResrceService resrceService;
@Autowired @Autowired
private NwaUserService nwaUserService; private NwaUserService nwaUserService;
@Autowired
private NwaUserMapper nwaUserMapper;
@Autowired
private DataFieldListService dataFieldListService;
@Override
public HashMap<String, Object> init() {
HashMap<String, Object> hashMap = new HashMap<>();
String site = CommonMethods.getSite();
//原因分类
DataField dealWay = new DataField();
dealWay.setSite(site);
dealWay.setDataField("REPAIR_DEAL_WAY");
List<DataField> dealWayList = dataFieldListService.findDataFieldListById(dealWay);
hashMap.put("REPAIR_DEAL_WAY",dealWayList);
return hashMap;
}
@Override @Override
public IPage<ResourceRepairTask> selectPage(FrontPage<ResourceRepairTask> frontPage, ResourceRepairTask resourceRepairTask) { public IPage<ResourceRepairTask> selectPage(FrontPage<ResourceRepairTask> frontPage, ResourceRepairTask resourceRepairTask) {
@ -240,11 +260,22 @@ public class ResourceRepairTaskServiceImpl extends ServiceImpl<ResourceRepairTas
@Override @Override
public ResourceRepairTask findResourceRepairTaskByHandleAndSite(String site, String handle) { public ResourceRepairTask findResourceRepairTaskByHandleAndSite(String site, String handle) {
ResourceRepairTask repairTask = resourceRepairTaskMapper.findResourceRepairTaskByHandleAndSite(site, handle);
// 耗用备品
ResourceInspectTaskSpare taskSpare = new ResourceInspectTaskSpare(); ResourceInspectTaskSpare taskSpare = new ResourceInspectTaskSpare();
taskSpare.setResourceInspectTaskBo(handle); taskSpare.setResourceInspectTaskBo(handle);
List<ResourceInspectTaskSpare> spareList = resourceInspectTaskSpareService.selectList(taskSpare); List<ResourceInspectTaskSpare> spareList = resourceInspectTaskSpareService.selectList(taskSpare);
ResourceRepairTask repairTask = resourceRepairTaskMapper.findResourceRepairTaskByHandleAndSite(site, handle);
repairTask.setSpareList(spareList); repairTask.setSpareList(spareList);
// 维修用户的中文名称
String repairUsers = repairTask.getRepairUsers();
if (repairUsers != null && !repairUsers.equals("")){
String[] split = repairUsers.split(",");
if (split.length > 0){
List<String> list = Arrays.asList(split);
String userNameList = nwaUserMapper.getFullNameCommaByUserNameList(site, list);
repairTask.setRepairUserName(userNameList);
}
}
return repairTask; return repairTask;
} }

@ -24,4 +24,10 @@ public interface NwaUserMapper extends BaseMapper<NwaUser> {
List<NwaUser> selectAllByUserGroups(@Param("site")String site,@Param("list")List<String> list); List<NwaUser> selectAllByUserGroups(@Param("site")String site,@Param("list")List<String> list);
int checkUser(@Param("site")String site,@Param("list")List<String> list); int checkUser(@Param("site")String site,@Param("list")List<String> list);
/**
* userName使
* */
String getFullNameCommaByUserNameList(@Param("site")String site,@Param("list")List<String> list);
} }

@ -596,4 +596,18 @@
</foreach>) </foreach>)
</if> </if>
</select> </select>
<select id="getFullNameCommaByUserNameList" resultType="java.lang.String">
SELECT LISTAGG(ZNU.FULL_NAME ,',') WITHIN GROUP (ORDER BY ZNU.SITE) AS STR
FROM Z_NWA_USER ZNU
WHERE ZNU.SITE = #{site}
<if test="list != null and !list.isEmpty">
AND ZNU.USER_NAME IN (
<foreach item="item" index="index" collection="list" separator=",">
UPPER(#{item})
</foreach>)
</if>
GROUP BY ZNU.SITE
</select>
</mapper> </mapper>

Loading…
Cancel
Save