| | |
| | | } |
| | | |
| | | @ApiOperation(value = "新增工艺路线维护-->选择工序") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "type", value = "类型(为空=0橡胶连接器)", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @GetMapping("/chooseTech") |
| | | public Result chooseTech() { |
| | | return Result.success(technologyTemplateService.chooseTech()); |
| | | public Result chooseTech(Integer type) { |
| | | return Result.success(technologyTemplateService.chooseTech(type)); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增工艺路线维护-->选择元件") |
| | |
| | | public interface TechnologyTemplateMapper extends BaseMapper<TechnologyTemplate> { |
| | | |
| | | //新增工艺路线-->选择工序 |
| | | List<String> chooseTech(); |
| | | List<String> chooseTech(Integer type); |
| | | |
| | | //查询工艺路线列表-->左边二级展示 |
| | | List<Map<String,Object>> selectAllTechTem(Integer type,String message); |
| | |
| | | *新增工艺路线-->选择工序 |
| | | * @return |
| | | */ |
| | | List<String> chooseTech(); |
| | | List<String> chooseTech(Integer type); |
| | | |
| | | /** |
| | | * 新增工艺路线-->选择元件 |
| | |
| | | |
| | | //新增工艺路线-->选择工序 |
| | | @Override |
| | | public List<String> chooseTech() { |
| | | return technologyTemplateMapper.chooseTech(); |
| | | public List<String> chooseTech(Integer type) { |
| | | return technologyTemplateMapper.chooseTech(type); |
| | | } |
| | | |
| | | //新增工艺路线-->选择元件 |
| | |
| | | <result property="name" column="techName"/> |
| | | </resultMap> |
| | | <select id="chooseTechFath" resultMap="chooseTechFathMap"> |
| | | select id techTemId, |
| | | select id techTemId, |
| | | name techName, |
| | | father techFather |
| | | from mom_ocean.technology_template |
| | |
| | | select technical_model.father, |
| | | technical_model.name, |
| | | unit, |
| | | technology_template.id, |
| | | technology_template.name techName, |
| | | technology_template.father techFather, |
| | | type |
| | |
| | | <!--删除根据工艺路线id--> |
| | | <update id="delTeMoByTechId"> |
| | | update mom_ocean.technical_model |
| | | set state=0 |
| | | where tech_tem_id=#{id} |
| | | set state=0 |
| | | where tech_tem_id = #{id} |
| | | </update> |
| | | |
| | | <!--批量删除根据工艺路线id--> |
| | |
| | | select distinct father |
| | | from mom_ocean.technology_template |
| | | where state = 1 |
| | | and type = #{type} |
| | | </select> |
| | | |
| | | <!--根据id查看详情--> |
| | |
| | | }) |
| | | @GetMapping("/list_user") |
| | | public Result<?> selectInspectionItem(Integer id, Integer type) { |
| | | List<InspectionItemDto> inspectionItemDto = inspectionItemService.selectInspectionItem(id,type); |
| | | List<InspectionItemDto> inspectionItemDto = inspectionItemService.selectInspectionItem(id, type); |
| | | return Result.success(inspectionItemDto); |
| | | } |
| | | |
| | |
| | | }) |
| | | @GetMapping("/chooseDev") |
| | | public Result<?> chooseDev(Integer technologyId, String father, String name) { |
| | | return Result.success(inspectionItemService.chooseDev(technologyId,father,name)); |
| | | return Result.success(inspectionItemService.chooseDev(technologyId, father, name)); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增按钮-->2、检验项目的检验值-->失去焦点发起该请求") |
| | | @ApiOperation(value = "检验项目的检验值-->失去焦点发起该请求") |
| | | @PostMapping("/lose_focus_update") |
| | | public Result<?> addInspectionItem(@RequestHeader("token") String token, @RequestBody UpdateInspectionItemDto updateInspectionItemDto) throws Exception { |
| | | Map<String, String> usernameMessage = jwt.readJWT(token); |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "更改设备") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "检验单Id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "type", value = "类型", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "DevId", value = "设备id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/updateDevByInsId") |
| | | public Result updateDevByInsId(Integer id, Integer type, Integer devId) { |
| | | inspectionItemService.updateDevByInsId(id, type, devId); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | |
| | | private String inspectionValue; |
| | | |
| | | @ApiModelProperty(value = "试验设备") |
| | | private Integer deviceId; |
| | | private String dname; |
| | | |
| | | @ApiModelProperty(value = "结论") |
| | | private Integer result; |
| | |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> chooseDev(Integer technologyId, String father, String name); |
| | | |
| | | |
| | | /** |
| | | * 更改设备 |
| | | * @param id |
| | | * @param type |
| | | * @param devId |
| | | */ |
| | | void updateDevByInsId(Integer id, Integer type, Integer devId); |
| | | |
| | | } |
| | |
| | | import com.yuanchu.mom.mapper.InspectionItemMapper; |
| | | import com.yuanchu.mom.mapper.TechniqueMapper; |
| | | import com.yuanchu.mom.pojo.InspectionItem; |
| | | import com.yuanchu.mom.pojo.RawInsProduct; |
| | | import com.yuanchu.mom.pojo.dto.InspectionItemDto; |
| | | import com.yuanchu.mom.pojo.dto.UpdateInspectionItemDto; |
| | | import com.yuanchu.mom.service.DeviceService; |
| | |
| | | return techniqueMapper.selDevByVerTecIdFaNam(technologyId, father, name, ver); |
| | | } |
| | | |
| | | //更改设备 |
| | | @Override |
| | | public void updateDevByInsId(Integer id, Integer type, Integer devId) { |
| | | InspectionItem inspectionItem = new InspectionItem(); |
| | | inspectionItem.setId(id); |
| | | inspectionItem.setType(type); |
| | | inspectionItem.setDeviceId(devId); |
| | | inspectionItem.setInspectionValue(null); |
| | | inspectionItem.setResult(null); |
| | | inspectionItemMapper.updateById(inspectionItem); |
| | | } |
| | | |
| | | //新增按钮-->2、检验项目-->失去焦点发起该请求 |
| | | @Override |
| | | public Integer addProcessInspectionSheet(String username, UpdateInspectionItemDto updateInspectionItemDto) { |
| | |
| | | @ApiImplicitParam(name = "name", value = "产品名称", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "specifications", value = "产品型号", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "time", value = "入库日期", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "type", value = "类型(为空=全部)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "result", value = "检验结果(为空=全部)", dataTypeClass = Integer.class) |
| | | @ApiImplicitParam(name = "type", value = "类型(为空=全部)", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/selectAllRepertory") |
| | | public Result selectAllRepertory(int pageSize, int countSize, String name, String specifications, String time, Integer type,Integer result) { |
| | | IPage<Map<String, Object>> repertoryPage = repertoryService.selectAllRepertory(new Page<Object>(pageSize, countSize), name, specifications, time, type,result); |
| | | public Result selectAllRepertory(int pageSize, int countSize, String name, String specifications, String time, Integer type) { |
| | | IPage<Map<String, Object>> repertoryPage = repertoryService.selectAllRepertory(new Page<Object>(pageSize, countSize), name, specifications, time, type); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", repertoryPage.getTotal()); |
| | | map.put("row", repertoryPage.getRecords()); |
| | |
| | | public interface RepertoryMapper extends BaseMapper<Repertory> { |
| | | |
| | | //查询所有库存列表 |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer result); |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type); |
| | | |
| | | } |
| | | |
| | |
| | | * @param type |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer result); |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type); |
| | | |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | .build(); |
| | | //新增生产订单 |
| | | manufactureOrderMapper.insert(manufactureOrder); |
| | | //查询产品的最新工序 |
| | | //产品编码 |
| | | String code = materialMapper.selMcode(manufactureOrder.getName()); |
| | | //型号id |
| | | Integer specificationId = getSpecificationId(manufactureOrder.getName(), code, manufactureOrder.getSpecifications()); |
| | | //默认最新版本 |
| | | Integer version = technologyMapper.selectVerByTec(specificationId).get(0); |
| | | List<Technology> technologyList = technologyMapper.selectList(Wrappers.<Technology>query() |
| | | .eq("specifications_id", specificationId) |
| | | .eq("version", version)); |
| | | /*正序查询该型号最新版本下的工艺路线*/ |
| | | LambdaQueryWrapper<Technology> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Technology::getSpecificationsId,specificationId); |
| | | queryWrapper.eq(Technology::getVersion,version); |
| | | queryWrapper.orderByAsc(Technology::getFather); |
| | | List<Technology> technologyList = technologyMapper.selectList(queryWrapper); |
| | | for (Technology technology : technologyList) { |
| | | ManualTechnology manualTechnology = ManualTechnology.builder() |
| | | .techname(technology.getName()) |
| | |
| | | |
| | | //查询所有库存列表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer result) { |
| | | return repertoryMapper.selectAllRepertory(page,name,specifications,time,type,result); |
| | | public IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type) { |
| | | return repertoryMapper.selectAllRepertory(page,name,specifications,time,type); |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | |
| | | |
| | | //新增销售单 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String addSale(String saleman, SaleDto saleDto) { |
| | | Sale sale = new Sale(); |
| | | BeanUtils.copyProperties(saleDto, sale); |
| | |
| | | |
| | | //根据销售单id删除 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delSale(Integer id) { |
| | | Sale sale = saleMapper.selectById(id); |
| | | sale.setState(0); |
| | |
| | | |
| | | //根据id批量删除 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delAllSale(List<Integer> ids) { |
| | | List<Sale> sales = saleMapper.selectBatchIds(ids); |
| | | for (Sale sale : sales) { |
| | |
| | | |
| | | //根据销售单id修改信息 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateSaleById(String saleman, Integer id, SaleVo saleVo) { |
| | | Sale sale = saleMapper.selectById(id); |
| | | sale.setSaleman(saleman); |
| | |
| | | List<SaleMaterialDto> saleMaterialDtos = saleVo.getSaleMaterialList(); |
| | | for (SaleMaterialDto saleMaterialDto : saleMaterialDtos) { |
| | | SaleMaterial saleMaterial = new SaleMaterial(); |
| | | BeanUtils.copyProperties(saleMaterialDto,saleMaterial); |
| | | BeanUtils.copyProperties(saleMaterialDto, saleMaterial); |
| | | saleMaterialMapper.updateById(saleMaterial); |
| | | } |
| | | } |
| | | |
| | | //审核 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void check(String checkname, Integer id, Integer type) { |
| | | Sale sale = saleMapper.selectById(id); |
| | | sale.setType(type); |
| | |
| | | return Result.success("添加生产工艺成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据id查看详情") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "生产工艺id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selTeqById") |
| | | public Result selTeqById(Integer id) { |
| | | return Result.success(techniqueService.selTeqById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "编辑") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "生产工艺id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "product", value = "检验项目(父类)", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "productFather", value = "指标(子项目)", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "unit", value = "单位", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/wriTeqById") |
| | | public Result wriTeqById(Integer id, String product, String productFather, String unit) { |
| | | return Result.success(techniqueService.wriTeqById(id, product, productFather, unit)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "生产工艺id", dataTypeClass = Integer.class,required = true) |
| | | @ApiImplicitParam(name = "id", value = "生产工艺id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delTeqById") |
| | | public Result delTeqById(Integer id) { |
| | | techniqueService.delTeqById(id); |
| | | return Result.success("删除"+id+"成功!"); |
| | | return Result.success("删除" + id + "成功!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "生产工艺id", dataTypeClass = String.class,required = true) |
| | | @ApiImplicitParam(name = "ids", value = "生产工艺id", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/delAllTeq") |
| | | public Result delAllTeq(String ids) { |
| | |
| | | return Result.fail("更新失败"); |
| | | } |
| | | |
| | | @ApiOperation("选择设备组,鼠标移开保存") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "工艺路线id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "deviceGroup", value = "设备组", dataTypeClass = String.class, required = true) |
| | | |
| | | }) |
| | | @PostMapping("/writeDevice") |
| | | public Result<?> writeDevice(Integer id, String deviceGroup) { |
| | | Integer write = technologyService.writeDevice(id, deviceGroup); |
| | | if (write >= 1) { |
| | | return Result.success("更新成功"); |
| | | } |
| | | return Result.fail("更新失败"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "删除") |
| | | @ApiImplicitParams(value = { |
| | |
| | | |
| | | //查询该工艺下最新版本在一个检验项目下可以使用哪些设备 |
| | | List<Map<String, Object>> selDevByVerTecIdFaNam(Integer technologyId, String father, String name, Integer ver); |
| | | |
| | | //根据id查看详情 |
| | | List<Map<String, Object>> selTeqById(Integer id); |
| | | } |
| | | |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | |
| | | |
| | | |
| | | /** |
| | | * 检验模块-->OMS管理-->成品检验-->新增(需要规格型号的Id与名称) |
| | | */ |
| | | List<Map<String, Object>> selectSpecificationIdAndName(Integer materialId); |
| | | |
| | | /** |
| | | * (4级)新增-->型号 |
| | | * @param specificationsDto |
| | | */ |
| | |
| | | * @param ids |
| | | */ |
| | | void delAllTeq(String ids); |
| | | |
| | | /** |
| | | * 根据id查看详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> selTeqById(Integer id); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param id |
| | | * @param product |
| | | * @param productFather |
| | | * @param unit |
| | | * @return |
| | | */ |
| | | String wriTeqById(Integer id, String product, String productFather, String unit); |
| | | } |
| | | |
| | |
| | | * @param ids |
| | | */ |
| | | void delAllTech(String ids); |
| | | |
| | | /** |
| | | * 选择设备组,鼠标移开保存 |
| | | * @param id |
| | | * @param deviceGroup |
| | | * @return |
| | | */ |
| | | Integer writeDevice(Integer id, String deviceGroup); |
| | | |
| | | } |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.TechnologyMapper; |
| | | import com.yuanchu.mom.pojo.Product; |
| | | import com.yuanchu.mom.pojo.dto.ProductDto; |
| | | import com.yuanchu.mom.service.ProductService; |
| | | import com.yuanchu.mom.mapper.ProductMapper; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | if (requ != '>' && requ != '<' && requ != '=') { |
| | | return "标准值输入格式有问题!"; |
| | | } |
| | | |
| | | Product product = new Product(); |
| | | product.setId(id); |
| | | product.setRequired(required); |
| | |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | //(4级)新增-->型号 |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String addSpecifications(SpecificationsDto specificationsDto) { |
| | | //校验添加该标准下的型号是否重复 |
| | | List<String> specificationsNameList = specificationsMapper.selectList(Wrappers.<Specifications>query().eq("standard_id", specificationsDto.getId())).stream().map(specifications -> { |
| | |
| | | } |
| | | techniqueService.saveBatch(techniqueList); |
| | | return "添加型号【"+ specificationsDto.getSpecifications() +"】成功!"; |
| | | } |
| | | |
| | | /** |
| | | * 检验模块-->QMS管理-->成品检验-->新增(需要规格型号的Id与名称) |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> selectSpecificationIdAndName(Integer materialId) { |
| | | List<Map<String, Object>> maps = specificationsMapper.selectSpecificationIdAndName(materialId); |
| | | return maps; |
| | | } |
| | | |
| | | } |
| | |
| | | public void delAllTeq(String ids) { |
| | | techniqueMapper.delAllTeq(ids); |
| | | } |
| | | |
| | | //根据id查看详情 |
| | | @Override |
| | | public List<Map<String, Object>> selTeqById(Integer id) { |
| | | return techniqueMapper.selTeqById((id)); |
| | | } |
| | | |
| | | //编辑 |
| | | @Override |
| | | public String wriTeqById(Integer id, String product, String productFather, String unit) { |
| | | Technique technique = new Technique(); |
| | | technique.setId(id); |
| | | technique.setProduct(product); |
| | | technique.setProductFather(productFather); |
| | | technique.setUnit(unit); |
| | | techniqueMapper.updateById(technique); |
| | | return "修改成功!"; |
| | | } |
| | | } |
| | | |
| | |
| | | MbomMapper mbomMapper; |
| | | |
| | | @Resource |
| | | MbomService mbomService; |
| | | |
| | | @Resource |
| | | TechniqueMapper techniqueMapper; |
| | | |
| | | @Resource |
| | | ProductService productService; |
| | | |
| | | @Resource |
| | | TechniqueService techniqueService; |
| | | |
| | | |
| | | //根据型号id查询版本 |
| | |
| | | //批量删除生产工艺表 |
| | | techniqueMapper.delAllByTecId(ids); |
| | | } |
| | | |
| | | //选择设备组,鼠标移开保存 |
| | | @Override |
| | | public Integer writeDevice(Integer id, String deviceGroup) { |
| | | Technology technology = new Technology(); |
| | | technology.setId(id); |
| | | technology.setDeviceGroup(deviceGroup); |
| | | return technologyMapper.updateById(technology); |
| | | } |
| | | } |
| | |
| | | and version = #{ver} |
| | | </select> |
| | | |
| | | <!--根据id查看详情--> |
| | | <select id="selTeqById" resultType="java.util.Map"> |
| | | select m.father, |
| | | type, |
| | | m.name, |
| | | st.name, |
| | | sp.name, |
| | | t.father, |
| | | t.name, |
| | | technology_id, |
| | | device, |
| | | product_father, |
| | | product, |
| | | unit |
| | | from mom_ocean.technique tq |
| | | left join mom_ocean.technology t on tq.technology_id = t.id |
| | | left join mom_ocean.specifications sp on t.specifications_id = sp.id |
| | | left join mom_ocean.standard st on sp.standard_id = st.id |
| | | left join mom_ocean.material m on st.material_id = m.id |
| | | where tq.state = 1 |
| | | and tq.id = #{id} |
| | | </select> |
| | | |
| | | <!--根据工艺路线id删除生产工艺--> |
| | | <update id="delTeqByTecId"> |
| | | update mom_ocean.technique |