Merge remote-tracking branch 'origin/master'

This commit is contained in:
15856 2024-10-16 10:57:44 +08:00
commit 7e1ab7b6a8
15 changed files with 173 additions and 50 deletions

View File

@ -31,6 +31,10 @@ public enum TaskStatusEnum {
* 维修进行中
*/
REPAIRING("43", "维修进行中"),
/**
* 维修待进行
*/
REPAIRPENDING("42", "维修待进行"),
/**
* 待报废任务--待审核

View File

@ -223,14 +223,14 @@ public class BackReceiveServiceImpl implements BackReceiveService {
throw new RuntimeException("input_apply_details");
}
// 如果是成套的机具成套机具的库存也要添加
List<BackApplyInfo> ctList = backReceiveMapper.getCtList(record);
if (ctList.size() > 0) {
for (BackApplyInfo backApplyInfo : ctList) {
if ("2".equals(backApplyInfo.getManageType())) {
backReceiveMapper.updateMt(backApplyInfo);
}
}
}
// List<BackApplyInfo> ctList = backReceiveMapper.getCtList(record);
// if (ctList.size() > 0) {
// for (BackApplyInfo backApplyInfo : ctList) {
// if ("2".equals(backApplyInfo.getManageType())) {
// backReceiveMapper.updateMt(backApplyInfo);
// }
// }
// }
res = updateMt(hgList);
if (res == 0) {
throw new RuntimeException("ma_type");
@ -493,8 +493,8 @@ public class BackReceiveServiceImpl implements BackReceiveService {
applyInfo.setTaskType(Integer.valueOf(taskType));
String taskStatus = "";
if (TaskTypeEnum.MAINTENANCE_TASK.getCode().equals(taskType)) {
//taskStatus = "43";
taskStatus = TaskStatusEnum.REPAIRING.getCode();
//taskStatus = "42";
taskStatus = TaskStatusEnum.REPAIRPENDING.getCode();
}
if (TaskTypeEnum.SCRAP_TASK.getCode().equals(taskType)) {
//taskStatus = "120";

View File

@ -268,6 +268,12 @@ public class MaTypeController extends BaseController {
@Log(title = "机具类型管理ma_type", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MaType maType) {
Long parentId = maType.getParentId();
List<MaType> subMas = maTypeMapper.getListByParentId(parentId, null);
boolean containsSameBrother = subMas.stream().anyMatch(o -> o.getTypeName().equals(maType.getTypeName()));
if (containsSameBrother) {
return AjaxResult.error("修改失败,同级存在相同名称");
}
return toAjax(iTypeService.updateMaType(maType));
}

View File

@ -53,7 +53,7 @@ public class MaTypeServiceImpl implements ITypeService {
public int insertMaType(MaType maType) {
Long parentId = maType.getParentId();
List<MaType> subMas = maTypeMapper.getListByParentId(parentId, null);
boolean containsSameBrother = subMas.stream().anyMatch(o -> o.getTypeName().contains(maType.getTypeName()));
boolean containsSameBrother = subMas.stream().anyMatch(o -> o.getTypeName().equals(maType.getTypeName()));
if (containsSameBrother) {
return 0;
}

View File

@ -10,9 +10,10 @@ import com.bonus.sgzb.base.service.RepairService;
import com.bonus.sgzb.common.core.exception.ServiceException;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import com.bonus.sgzb.material.domain.TmTask;
import com.bonus.sgzb.material.mapper.TaskMapper;
import com.bonus.sgzb.system.api.domain.SysUser;
import com.bonus.sgzb.system.api.model.LoginUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -30,6 +31,9 @@ public class RepairServiceImpl implements RepairService {
@Autowired
private RepairMapper mapper;
@Autowired
private TaskMapper taskMapper;
@Override
public List<RepairTask> getRepairTaskList(RepairTask bean) {
@ -58,6 +62,12 @@ public class RepairServiceImpl implements RepairService {
bean.setCreateBy(loginUser.getUserid());
List<RepairPartDetails> partList = bean.getPartList();
BigDecimal sfCosts = new BigDecimal("0");
// 修改任务状态
TmTask tmTask = new TmTask();
tmTask.setTaskStatus(43);
tmTask.setTaskId(Long.valueOf(bean.getTaskId()));
taskMapper.updateTashStatus(tmTask);
String nbType = "1";
String fcType = "2";
String sfPart = "1";

View File

@ -38,14 +38,14 @@ public class PurchasePartInfo extends BaseEntity
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "采购日期")
private Date purchaseTime;
private String purchaseTime;
/** 到货日期 */
@ApiModelProperty(value = "到货日期")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "到货日期")
private Date arrivalTime;
private String arrivalTime;
/** 采购员 */
@ApiModelProperty(value = "采购员")
@ -167,21 +167,21 @@ public class PurchasePartInfo extends BaseEntity
{
return taskId;
}
public void setPurchaseTime(Date purchaseTime)
public void setPurchaseTime(String purchaseTime)
{
this.purchaseTime = purchaseTime;
}
public Date getPurchaseTime()
public String getPurchaseTime()
{
return purchaseTime;
}
public void setArrivalTime(Date arrivalTime)
public void setArrivalTime(String arrivalTime)
{
this.arrivalTime = arrivalTime;
}
public Date getArrivalTime()
public String getArrivalTime()
{
return arrivalTime;
}

View File

@ -6,6 +6,7 @@ import com.bonus.sgzb.material.domain.CalMonthlyBean;
import com.bonus.sgzb.material.domain.ProjectMonthCosts;
import com.bonus.sgzb.material.domain.ProjectMonthDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -41,4 +42,10 @@ public interface CalMonthlyMapper {
List<SltAgreementInfo> getMonthCosts(AgreementInfo agreementInfo);
List<SltAgreementInfo> getMonthDetails(SltAgreementInfo monthCost);
void deleteCostByProjectIdAndMonth(ProjectMonthCosts projectMonthCosts);
List<String> selectIdByProjectIdAndMonth(ProjectMonthCosts projectMonthCosts);
void deleteDetailsByProMonthCostId(@Param("proMonthCostId") String proMonthCostId);
}

View File

@ -79,6 +79,7 @@ public interface TaskMapper {
int insertSelective(TmTask bean);
int insertAgreement(TmTask task);
int updateTashStatus(TmTask task);
int insertTmTaskByBackInfo(BackApplyInfo backApplyInfo);

View File

@ -17,7 +17,7 @@ public class Inform {
@Value("${sgzb.job.settlementJobDay}")
private String settlementJobDay;
//@Scheduled(cron = "0 */3 * * * ? ") // 间隔3分钟执行
// @Scheduled(cron = "0 */5 * * * ? ") // 间隔5分钟执行
@Scheduled(cron = "${sgzb.job.settlementJobCron}") // 结算日次日凌晨执行
@Async
public void taskCycle() {

View File

@ -51,9 +51,9 @@ public class CalcMonthlyServiceImp implements CalcMonthlyService {
record.setMonth(month);
cleanSameMonthOldRecords(record);
List<AgreementInfo> list = agreementInfoService.getAllAgreementId();
List<BmProjectLot> projectLots = agreementInfoService.getAllprojectId();
// List<BmProjectLot> projectLots = agreementInfoService.getAllprojectId();
// 如果该工程费用指标已超过则不需要记录月结记录
for (BmProjectLot bmProjectLot : projectLots) {
/* for (BmProjectLot bmProjectLot : projectLots) {
BigDecimal costIndicatorsByLotId = agreementInfoService.getCostIndicatorsByLotId(bmProjectLot);
BigDecimal costByLotId = agreementInfoService.getCostByLotId(bmProjectLot);
if (costByLotId.compareTo(costIndicatorsByLotId) > 0) {
@ -61,7 +61,7 @@ public class CalcMonthlyServiceImp implements CalcMonthlyService {
List<AgreementInfo> agreementIds = agreementInfoService.getprojectIdByLotId(bmProjectLot);
agreementIds.forEach(t -> list.remove(t));
}
}
}*/
list.forEach(t -> {
t.setStartTime(startTime);
t.setEndTime(endTime);
@ -83,7 +83,7 @@ public class CalcMonthlyServiceImp implements CalcMonthlyService {
}
}
private List<SltAgreementInfo> addProjectMonthCosts(List<AgreementInfo> list, CalMonthlyBean record) {
private void addProjectMonthCosts(List<AgreementInfo> list, CalMonthlyBean record) {
List<SltAgreementInfo> leaseList = new ArrayList<>();
calMonthlyMapper.insertCalcRecord(record);
String taskId = record.getId();
@ -112,15 +112,29 @@ public class CalcMonthlyServiceImp implements CalcMonthlyService {
agreementInfo.setIds(sltAgreementInfo.getIds());
sltAgreementInfo.setMonth(bean.getMonth());
agreementInfo.setEndTime(sltAgreementInfo.getOffTime());
List<SltAgreementInfo> leaseListOneMonth = addProjectMonthDetail(agreementInfo, sltAgreementInfo, pmcId);
// 新增project_month_detail
addProjectMonthDetail(agreementInfo, sltAgreementInfo, pmcId);
projectMonthCosts.setCosts(sltAgreementInfo.getCosts());
calMonthlyMapper.updateProMonCosts(projectMonthCosts);
sltAgreementInfo.setNode(leaseListOneMonth);
}
leaseList.addAll(monthList);
// 如果该工程费用指标已超过则不需要记录月结记录
BmProjectLot bmProjectLot = new BmProjectLot();
bmProjectLot.setLotId(projectMonthCosts.getProjectId());
// 获取已结算金额
BigDecimal costByLotId = agreementInfoService.getCostByLotId(bmProjectLot);
// 获取该工程费用指标
BigDecimal costIndicatorsByLotId = agreementInfoService.getCostIndicatorsByLotId(bmProjectLot);
if (costByLotId.compareTo(costIndicatorsByLotId) > 0) {
List<String> proMonthCostIds = calMonthlyMapper.selectIdByProjectIdAndMonth(projectMonthCosts);
calMonthlyMapper.deleteCostByProjectIdAndMonth(projectMonthCosts);
for (String proMonthCostId : proMonthCostIds) {
calMonthlyMapper.deleteDetailsByProMonthCostId(proMonthCostId);
}
}
break;
}
}
}
return leaseList;
}

View File

@ -82,6 +82,9 @@ public class PurchaseCheckDetailsServiceImpl implements IPurchaseCheckDetailsSer
purchaseCheckDetails.setStatus(2);
}
purchaseCheckDetails.setUpdateTime(DateUtils.getNowDate());
if ("1".equals(purchaseCheckDetails.getManageType())){
purchaseCheckDetails.setBindNum(purchaseCheckDetails.getCheckNum());
}
purchaseCheckDetailsMapper.updatePurchaseCheckDetails(purchaseCheckDetails);
}
//判断是否全部已操作不通过或通过

View File

@ -85,30 +85,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectMaPartType" parameterType="com.bonus.sgzb.base.domain.MaPartType" resultMap="MaPartTypeResult">
SELECT
SELECT DISTINCT
t1.pa_id,
t1.pa_name,
t1.parent_id,
t1.status,
t1.STATUS,
t1.num,
t1.unit_id,
t1.buy_price,
t1.level,
t1.LEVEL,
t1.warn_num,
t1.del_flag,
t1.create_by,
t1.create_time,
t1.remark,
t1.company_id,
t1.year
t1.YEAR
FROM
ma_part_type t1
LEFT JOIN
ma_part_type t2 ON t1.parent_id = t2.pa_id
LEFT JOIN
ma_part_type t3 ON t2.parent_id = t3.pa_id
LEFT JOIN ma_part_type t2 ON t1.parent_id = t2.pa_id
LEFT JOIN ma_part_type t3 ON t2.parent_id = t3.pa_id
WHERE
t1.del_flag = '0'
t1.del_flag = '0' and t1.pa_id is not null
<if test="paName != null and paName != ''">
AND (t1.pa_name LIKE CONCAT('%', #{paName}, '%')
OR t2.pa_name LIKE CONCAT('%', #{paName}, '%')
@ -117,7 +115,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="year != null and year != ''">
AND t1.year = #{year}
</if>
UNION
SELECT
t2.pa_id,
t2.pa_name,
t2.parent_id,
t2.STATUS,
t2.num,
t2.unit_id,
t2.buy_price,
t2.LEVEL,
t2.warn_num,
t2.del_flag,
t2.create_by,
t2.create_time,
t2.remark,
t2.company_id,
t2.YEAR
FROM
ma_part_type t1
LEFT JOIN ma_part_type t2 ON t1.parent_id = t2.pa_id
LEFT JOIN ma_part_type t3 ON t2.parent_id = t3.pa_id
WHERE
t2.del_flag = '0' and t2.pa_id is not null
<if test="paName != null and paName != ''">
AND (t1.pa_name LIKE CONCAT('%', #{paName}, '%')
OR t2.pa_name LIKE CONCAT('%', #{paName}, '%')
OR t3.pa_name LIKE CONCAT('%', #{paName}, '%'))
</if>
<if test="year != null and year != ''">
AND t2.year = #{year}
</if>
UNION
SELECT
t3.pa_id,
t3.pa_name,
t3.parent_id,
t3.STATUS,
t3.num,
t3.unit_id,
t3.buy_price,
t3.LEVEL,
t3.warn_num,
t3.del_flag,
t3.create_by,
t3.create_time,
t3.remark,
t3.company_id,
t3.YEAR
FROM
ma_part_type t1
LEFT JOIN ma_part_type t2 ON t1.parent_id = t2.pa_id
LEFT JOIN ma_part_type t3 ON t2.parent_id = t3.pa_id
WHERE
t3.del_flag = '0' and t3.pa_id is not null
<if test="paName != null and paName != ''">
AND (t1.pa_name LIKE CONCAT('%', #{paName}, '%')
OR t2.pa_name LIKE CONCAT('%', #{paName}, '%')
OR t3.pa_name LIKE CONCAT('%', #{paName}, '%'))
</if>
<if test="year != null and year != ''">
AND t3.year = #{year}
</if>
</select>

View File

@ -78,6 +78,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE
pmc.id = #{id}
</select>
<select id="selectIdByProjectIdAndMonth" resultType="java.lang.String">
select id from project_month_costs
where project_id = #{projectId} and month = #{month}
</select>
<delete id="deleteCalcRecord" parameterType="com.bonus.sgzb.material.domain.CalMonthlyBean">
delete from slt_project_month
@ -95,5 +99,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from project_month_costs
where task_id = #{id}
</delete>
<delete id="deleteCostByProjectIdAndMonth">
delete from project_month_costs
where project_id = #{projectId} and month = #{month}
</delete>
<delete id="deleteDetailsByProMonthCostId">
delete from project_month_detail
where pro_month_cost_id = #{proMonthCostId}
</delete>
</mapper>

View File

@ -115,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="purchasePrice != null">purchase_price = #{purchasePrice},</if>
<if test="purchaseNum != null">purchase_num = #{purchaseNum},</if>
<if test="checkNum != null">check_num = #{checkNum},</if>
<if test="bindNum != null">bind_num = #{bindNum},</if>
<if test="checkResult != null">check_result = #{checkResult},</if>
<if test="supplierId != null">supplier_id = #{supplierId},</if>
<if test="status != null">status = #{status},</if>

View File

@ -211,6 +211,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where task_id = #{taskId}
</update>
<update id="updateTashStatus">
UPDATE tm_task tt
SET tt.task_status = #{taskStatus}
WHERE
tt.task_id = #{taskId}
</update>
<delete id="deleteTmTaskByTaskId" parameterType="Long">
delete from tm_task where task_id = #{taskId}