| | |
| | | import java.net.URLDecoder; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.TranslateDictTextUtils; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.base.entity.ShiftGroup; |
| | | import org.jeecg.modules.base.entity.UserGroup; |
| | |
| | | |
| | | @Autowired |
| | | private IUserGroupService userGroupService; |
| | | |
| | | @Autowired |
| | | private ObjectMapper objectMapper; |
| | | @Autowired |
| | | private TranslateDictTextUtils translateDictTextUtils; |
| | | |
| | | /** |
| | | * 分页列表查询 |
| | |
| | | return Result.OK(shiftGroup); |
| | | } |
| | | |
| | | @AutoLog(value = "班组人员信息-通过产线id查询其下所有班组") |
| | | @ApiOperation(value="班组人员信息-通过产线id查询其下所有班组", notes = "班组人员信息-通过产线id查询其下所有班组") |
| | | @GetMapping(value = "/queryShiftGroupByFactoryId") |
| | | public Result<?> queryShiftGroupByFactoryId(@RequestParam(name="factoryId") String factoryId) { |
| | | List<ShiftGroup> shiftGroupList = shiftGroupService.list(new LambdaQueryWrapper<ShiftGroup>() |
| | | .eq(ShiftGroup::getFactoryId, factoryId) |
| | | .eq(ShiftGroup::getDelFlag, CommonConstant.DEL_FLAG_0)); |
| | | JSONArray array = new JSONArray(); |
| | | for (ShiftGroup shiftGroup : shiftGroupList) { |
| | | try { |
| | | String json = objectMapper.writeValueAsString(shiftGroup); |
| | | JSONObject item = JSONObject.parseObject(json); |
| | | translateDictTextUtils.translateField("shiftId", shiftGroup.getShiftId(), item, "base_shift,shift_name,id"); |
| | | translateDictTextUtils.translateField("shiftCode", shiftGroup.getShiftId(), item, "base_shift,shift_code,id"); |
| | | array.add(item); |
| | | } catch (JsonProcessingException e) { |
| | | return Result.error("数据转译失败!"); |
| | | } |
| | | } |
| | | return Result.OK(array); |
| | | } |
| | | |
| | | /** |
| | | * 导出excel |
| | | * |