Browse Source

2025-03-28

master
qiezi 1 year ago
parent
commit
77eda01512
  1. 5
      src/main/java/com/spring/modules/oss/service/impl/SysOssServiceImpl.java
  2. 38
      src/main/java/com/spring/modules/project/service/impl/ProjectServiceImpl.java
  3. 2
      src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java
  4. 2
      src/main/resources/mapper/customer/CustomerInformationMapper.xml
  5. 8
      src/main/resources/mapper/project/ProjectDao.xml
  6. 31
      src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml

5
src/main/java/com/spring/modules/oss/service/impl/SysOssServiceImpl.java

@ -9,7 +9,9 @@ import com.spring.modules.oss.entity.SysOssEntity;
import com.spring.modules.oss.service.SysOssService; import com.spring.modules.oss.service.SysOssService;
import com.spring.modules.oss.vo.OssVo; import com.spring.modules.oss.vo.OssVo;
import com.spring.modules.oss.vo.SysOssEntityData; import com.spring.modules.oss.vo.SysOssEntityData;
import com.spring.modules.sys.entity.SysUserEntity;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -102,6 +104,9 @@ public class SysOssServiceImpl extends ServiceImpl<SysOssDao, SysOssEntity> impl
oss.setUrl(path + "\\" + newFileName); oss.setUrl(path + "\\" + newFileName);
oss.setNewFileName(newFileName); oss.setNewFileName(newFileName);
oss.setCreateDate(date); oss.setCreateDate(date);
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
oss.setCreateBy(sysUserEntity.getUsername());
oss.setFileType(suffix); oss.setFileType(suffix);
this.save(oss); this.save(oss);
} }

38
src/main/java/com/spring/modules/project/service/impl/ProjectServiceImpl.java

@ -31,6 +31,7 @@ import org.springframework.util.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
@Service @Service
public class ProjectServiceImpl implements ProjectService { public class ProjectServiceImpl implements ProjectService {
@ -92,35 +93,42 @@ public class ProjectServiceImpl implements ProjectService {
@Override @Override
public List<PlmUserRoleData> searchUserRoll(PlmUserRoleData data){ public List<PlmUserRoleData> searchUserRoll(PlmUserRoleData data){
// 获得请求人
SysUserEntity sysUserEntity = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
List<PlmUserRoleData> list=projectDao.searchUserRoll(data); List<PlmUserRoleData> list=projectDao.searchUserRoll(data);
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
PlmUserRoleData plmUserRoleData = list.get(i);
plmUserRoleData.setSearchCheck(false);
plmUserRoleData.setUpdateCheck(false);
plmUserRoleData.setDownCheck(false);
plmUserRoleData.setDeleteCheck(false);
plmUserRoleData.setCheckAll(false);
if("Y".equals(list.get(i).getSearchFlag()) && "Y".equals(list.get(i).getUpdateFlag()) && "Y".equals(list.get(i).getDownFlag()) && "Y".equals(list.get(i).getDeleteFlag())){
list.get(i).setCheckAll(true);
}
if("Y".equals(list.get(i).getSearchFlag())){ if("Y".equals(list.get(i).getSearchFlag())){
list.get(i).setSearchCheck(true); list.get(i).setSearchCheck(true);
}else {
list.get(i).setSearchCheck(false);
} }
if("Y".equals(list.get(i).getUpdateFlag())){ if("Y".equals(list.get(i).getUpdateFlag())){
list.get(i).setUpdateCheck(true); list.get(i).setUpdateCheck(true);
}else {
list.get(i).setUpdateCheck(false);
} }
if("Y".equals(list.get(i).getDownFlag())){ if("Y".equals(list.get(i).getDownFlag())){
list.get(i).setDownCheck(true); list.get(i).setDownCheck(true);
}else {
list.get(i).setDownCheck(false);
} }
if("Y".equals(list.get(i).getDeleteFlag())){ if("Y".equals(list.get(i).getDeleteFlag())){
list.get(i).setDeleteCheck(true); list.get(i).setDeleteCheck(true);
}else {
list.get(i).setDeleteCheck(false);
} }
if("Y".equals(list.get(i).getSearchFlag())
&& "Y".equals(list.get(i).getUpdateFlag())
&& "Y".equals(list.get(i).getDownFlag())
&& "Y".equals(list.get(i).getDeleteFlag())){
list.get(i).setCheckAll(true);
}else {
list.get(i).setCheckAll(false);
// 如果为新增 找到当前操作人,默认全选
if (StringUtils.isEmpty(data.getProjectId()) && plmUserRoleData.getUsername().equals(sysUserEntity.getUsername())){
plmUserRoleData.setSearchCheck(true);
plmUserRoleData.setUpdateCheck(true);
plmUserRoleData.setDownCheck(true);
plmUserRoleData.setDeleteCheck(true);
plmUserRoleData.setCheckAll(true);
plmUserRoleData.setSearchFlag("Y");
plmUserRoleData.setUpdateFlag("Y");
plmUserRoleData.setDownFlag("Y");
plmUserRoleData.setDeleteFlag("Y");
} }
} }

2
src/main/java/com/spring/modules/sampleManagement/service/Impl/TechnicalSpecificationServiceImpl.java

@ -513,7 +513,7 @@ public class TechnicalSpecificationServiceImpl implements TechnicalSpecification
if(RoutingDetailEntity.size()>1){ if(RoutingDetailEntity.size()>1){
throw new RuntimeException("物料Route状态不为Buildable!请联系管理员员"); throw new RuntimeException("物料Route状态不为Buildable!请联系管理员员");
} }
if(RoutingDetailEntity.size()==0){
if(RoutingDetailEntity.isEmpty()){
throw new RuntimeException("未找到该物料编码的工艺路线或工艺路线不是Build状态!"); throw new RuntimeException("未找到该物料编码的工艺路线或工艺路线不是Build状态!");
} }
List<RoutingComponentVo> list= technicalSpecificationMapper.searchBMRoute(RoutingDetailEntity.get(0)); List<RoutingComponentVo> list= technicalSpecificationMapper.searchBMRoute(RoutingDetailEntity.get(0));

2
src/main/resources/mapper/customer/CustomerInformationMapper.xml

@ -47,7 +47,7 @@
AND customer_status = #{query.customerStatus} AND customer_status = #{query.customerStatus}
</if> </if>
</where> </where>
order by CAST(SUBSTRING(customer_no, 2, 6) AS INT) desc
order by CAST(SUBSTRING(customer_no, 2, 6) AS INT)
</select> </select>
<select id="customerInformationSearchForCheck" parameterType="com.spring.modules.customer.vo.CustomerInformationVo" <select id="customerInformationSearchForCheck" parameterType="com.spring.modules.customer.vo.CustomerInformationVo"
resultType="com.spring.modules.customer.vo.CustomerInformationVo"> resultType="com.spring.modules.customer.vo.CustomerInformationVo">

8
src/main/resources/mapper/project/ProjectDao.xml

@ -189,10 +189,10 @@
a.user_display, a.user_display,
c.site, c.site,
c.project_id, c.project_id,
isnull(c.searchFlag,'N') searchFlag,
isnull(c.updateFlag,'N') updateFlag,
isnull(c.downFlag,'N') downFlag,
isnull(c.deleteFlag,'N') deleteFlag
isnull(c.searchFlag,'N') as searchFlag,
isnull(c.updateFlag,'N') as updateFlag,
isnull(c.downFlag,'N') as downFlag,
isnull(c.deleteFlag,'N') as deleteFlag
from sys_user a from sys_user a
left join AccessSite b on a.username = b.UserID left join AccessSite b on a.username = b.UserID
left join AccessProject c on a.username = c.username and c.project_id = #{projectId} and c.site = b.site left join AccessProject c on a.username = c.username and c.project_id = #{projectId} and c.site = b.site

31
src/main/resources/mapper/sampleManagement/TechnicalSpecificationMapper.xml

@ -1024,19 +1024,28 @@ id
where site=#{site} and part_no=#{partNo} and routing_type=#{routingType} and routing_revision=#{routingRevision} where site=#{site} and part_no=#{partNo} and routing_type=#{routingType} and routing_revision=#{routingRevision}
</select> </select>
<select id="getBMBomDetail" resultType="com.spring.modules.part.entity.BomDetailEntity"> <select id="getBMBomDetail" resultType="com.spring.modules.part.entity.BomDetailEntity">
select a.site,a.bom_type,a.eng_chg_level,a.bom_alternative_no alternativeNo,b.final_part_no partNo
from plm_technical_specification_sheet a left join view_Project_final_Part b on a.site=b.site and a.test_part_no=b.test_part_no
left join plm_bom_detail c on a.site=c.site and b.final_part_no=c.part_no and a.eng_chg_level=c.eng_chg_level
and a.bom_alternative_no=c.alternative_no and a.bom_type=c.bom_type
where a.site=#{site} and a.code_no=#{codeNo} and a.project_id=b.project_id and c.status='Buildable'
select a.site, a.bom_type, a.eng_chg_level, a.bom_alternative_no alternativeNo, b.final_part_no partNo
from plm_technical_specification_sheet a
left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
left join plm_bom_detail c
on a.site = c.site and b.final_part_no = c.part_no and a.eng_chg_level = c.eng_chg_level
and a.bom_alternative_no = c.alternative_no and a.bom_type = c.bom_type
where a.site = #{site}
and a.code_no = #{codeNo}
and a.project_id = b.project_id
and c.status = 'Buildable'
</select> </select>
<select id="getBMRouteDetail" resultType="com.spring.modules.part.entity.RoutingDetailEntity"> <select id="getBMRouteDetail" resultType="com.spring.modules.part.entity.RoutingDetailEntity">
select a.site,a.routing_type,a.routing_revision,a.routing_alternative_no alternativeNo,b.final_part_no partNo
from plm_technical_specification_sheet a left join view_Project_final_Part b on a.site=b.site and a.test_part_no=b.test_part_no
left join plm_routing_detail c on a.site=c.site and b.final_part_no=c.part_no AND a.routing_revision=c.routing_revision
and a.routing_alternative_no=c.alternative_no and a.routing_type=c.routing_type
where a.site=#{site} and a.code_no=#{codeNo} and a.project_id=b.project_id and c.status='Buildable'
select a.site, a.routing_type, a.routing_revision, a.routing_alternative_no alternativeNo, b.final_part_no partNo
from plm_technical_specification_sheet a
left join view_Project_final_Part b on a.site = b.site and a.test_part_no = b.test_part_no
left join plm_routing_detail c
on a.site = c.site and b.final_part_no = c.part_no AND a.routing_revision = c.routing_revision
and a.routing_alternative_no = c.alternative_no and a.routing_type = c.routing_type
where a.site = #{site}
and a.code_no = #{codeNo}
and a.project_id = b.project_id
and c.status = 'Buildable'
</select> </select>

Loading…
Cancel
Save