Commit a3fa4c47 authored by 温志超's avatar 温志超

更新打印

parent 997adb32
...@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
import java.util.Objects; import java.util.Objects;
/** /**
...@@ -149,4 +150,13 @@ public class ProTaskWorkunitController extends BaseController { ...@@ -149,4 +150,13 @@ public class ProTaskWorkunitController extends BaseController {
} }
@ApiOperation("获取工序打印日记")
@Log(title = "获取工序打印日记", businessType = BusinessType.UPDATE)
@PostMapping(value= "/printData")
public AjaxResult printData(@RequestBody List<Long> taskIds) {
Map<String,Object> printData = proTaskWorkunitService.printData(taskIds);
return AjaxResult.success("获取成功",printData);
}
} }
...@@ -201,4 +201,6 @@ public class ProTaskWorkunit extends BaseEntity { ...@@ -201,4 +201,6 @@ public class ProTaskWorkunit extends BaseEntity {
private String orderCode; private String orderCode;
@ApiModelProperty("项目号") @ApiModelProperty("项目号")
private String customerProjectNo; private String customerProjectNo;
@ApiModelProperty("任务批号")
private String taskBatch;
} }
...@@ -191,4 +191,8 @@ public interface ProTaskMapper extends BaseMapper<ProTask> { ...@@ -191,4 +191,8 @@ public interface ProTaskMapper extends BaseMapper<ProTask> {
@Select("select p.task_id,pw.task_workunit_id,pw.task_workunit_id,pw.status from pro_task p LEFT JOIN pro_task_workunit pw on p.task_id=pw.task_id ${ew.customSqlSegment}") @Select("select p.task_id,pw.task_workunit_id,pw.task_workunit_id,pw.status from pro_task p LEFT JOIN pro_task_workunit pw on p.task_id=pw.task_id ${ew.customSqlSegment}")
List<ProTask> selectTaskWuListByQw(@Param("ew") QueryWrapper<ProTask> query); List<ProTask> selectTaskWuListByQw(@Param("ew") QueryWrapper<ProTask> query);
List<ProTask> selectByTaskIds(@Param("taskIds")List<Long> taskIds);
List<ProTask> selectByTaskBatch(@Param("taskBatch")String taskBatch);
} }
...@@ -138,7 +138,7 @@ public interface ProTaskWorkunitMapper { ...@@ -138,7 +138,7 @@ public interface ProTaskWorkunitMapper {
@Select(value = "select * from pro_task_workunit where task_id =#{taskId} and and actual_end_date is not null order by task_workunit_id limit 1") @Select(value = "select * from pro_task_workunit where task_id =#{taskId} and and actual_end_date is not null order by task_workunit_id limit 1")
ProTaskWorkunit selectTaskScheduledForearliestExec(@Param("taskId") Long taskId); ProTaskWorkunit selectTaskScheduledForearliestExec(@Param("taskId") Long taskId);
@Select(value = "select t.task_id, t.task_code, t.task_name\n" + @Select(value = "select t.task_id, t.task_code, t.task_name, t.task_batch\n" +
"\t, t.workstation_id, t.workstation_code, ws.workstation_name\n" + "\t, t.workstation_id, t.workstation_code, ws.workstation_name\n" +
"\t, t.process_id, t.process_code, t.process_name\n" + "\t, t.process_id, t.process_code, t.process_name\n" +
"\t, t.item_id, wo.product_code as item_code, wo.product_name as item_name,wo.customer_project_no,wo.order_code, t.specification, t.unit_of_measure\n" + "\t, t.item_id, wo.product_code as item_code, wo.product_name as item_name,wo.customer_project_no,wo.order_code, t.specification, t.unit_of_measure\n" +
......
...@@ -25,6 +25,7 @@ import com.ximai.mes.pro.dto.task.ProTaskWorkunitConvertRecordCreate; ...@@ -25,6 +25,7 @@ import com.ximai.mes.pro.dto.task.ProTaskWorkunitConvertRecordCreate;
import com.ximai.mes.pro.mapper.ProArrangeMapper; import com.ximai.mes.pro.mapper.ProArrangeMapper;
import com.ximai.mes.pro.mapper.ProFeedbackMapper; import com.ximai.mes.pro.mapper.ProFeedbackMapper;
import com.ximai.mes.pro.mapper.proWorkOrder.ProWorkorderMapper; import com.ximai.mes.pro.mapper.proWorkOrder.ProWorkorderMapper;
import com.ximai.mes.pro.mapper.task.ProTaskMapper;
import com.ximai.mes.pro.mapper.task.ProTaskWorkunitMapper; import com.ximai.mes.pro.mapper.task.ProTaskWorkunitMapper;
import com.ximai.mes.pro.service.IProAllocationMaterialService; import com.ximai.mes.pro.service.IProAllocationMaterialService;
import com.ximai.mes.pro.service.IProMaterialRequestService; import com.ximai.mes.pro.service.IProMaterialRequestService;
...@@ -65,6 +66,8 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService { ...@@ -65,6 +66,8 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
@Autowired @Autowired
private IProTaskService proTaskService; private IProTaskService proTaskService;
@Autowired @Autowired
private ProTaskMapper proTaskMapper;
@Autowired
private IProTaskWorkunitService proTaskWorkunitService; private IProTaskWorkunitService proTaskWorkunitService;
@Resource @Resource
private ProWorkorderMapper proWorkorderMapper; private ProWorkorderMapper proWorkorderMapper;
...@@ -554,4 +557,29 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService { ...@@ -554,4 +557,29 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
this.updateProTaskWorkunit(taskWorkunit); this.updateProTaskWorkunit(taskWorkunit);
this.updateProTaskWorkunitState(taskWorkunit, TaskStatusEnum.BEGINNING); this.updateProTaskWorkunitState(taskWorkunit, TaskStatusEnum.BEGINNING);
} }
@Override
public Map<String, Object> printData(List<Long> taskIds) {
if(taskIds.size() > 0){
Map<String, Object> printData = new HashMap<>();
ArrayList valueList = new ArrayList();
printData.put("reportName","mysql:qrcode-50*50-2");
printData.put("valueList",valueList);
List<ProTask> tasks = proTaskMapper.selectByTaskIds(taskIds);
List<String> taskBatchs = tasks.stream().map(proTask -> proTask.getTaskBatch()).distinct().collect(Collectors.toList());
for (String taskBatch : taskBatchs){
List<ProTask> taskBatchTasks = proTaskMapper.selectByTaskBatch(taskBatch);
if(taskBatchTasks.size() > 0){
Map<String,Object> value = new HashMap<>();
valueList.add( value);
ProWorkorder proWorkorder = proWorkorderMapper.selectProWorkorderWorderCode(taskBatchTasks.get(0).getArrangeCode());
value.put("header",proWorkorder);
value.put("detail",taskBatchTasks);
}
}
return printData;
}else{
return null;
}
}
} }
...@@ -14,6 +14,8 @@ import org.apache.ibatis.annotations.Param; ...@@ -14,6 +14,8 @@ import org.apache.ibatis.annotations.Param;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Objects;
/** /**
* 任务工作单元Service接口 * 任务工作单元Service接口
...@@ -169,4 +171,5 @@ public interface IProTaskWorkunitService { ...@@ -169,4 +171,5 @@ public interface IProTaskWorkunitService {
*/ */
void outsourceConfirm(ProTaskWorkunit taskWorkunit); void outsourceConfirm(ProTaskWorkunit taskWorkunit);
Map<String, Object> printData(List<Long> taskIds);
} }
...@@ -329,6 +329,21 @@ ...@@ -329,6 +329,21 @@
<include refid="selectProTaskVo"/> <include refid="selectProTaskVo"/>
where task_code = #{taskCode} where task_code = #{taskCode}
</select> </select>
<select id="selectByTaskIds" resultType="com.ximai.mes.pro.domain.task.ProTask">
<include refid="selectProTaskVo"/>
<where>
t.task_id in
<foreach item="item" collection="taskIds" open="(" separator="," close=")">
#{item}
</foreach>
</where>
</select>
<select id="selectByTaskBatch" resultType="com.ximai.mes.pro.domain.task.ProTask">
<include refid="selectProTaskDetailVo"/>
<where>
t.task_batch = #{taskBatch}
</where>
</select>
<insert id="insertProTask" parameterType="ProTask" useGeneratedKeys="true" keyProperty="taskId"> <insert id="insertProTask" parameterType="ProTask" useGeneratedKeys="true" keyProperty="taskId">
insert into pro_task insert into pro_task
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment