盘点入库详情

This commit is contained in:
mashuai 2024-05-28 17:08:12 +08:00
parent 85997e5401
commit 6b89c6f089
7 changed files with 121 additions and 29 deletions

View File

@ -58,9 +58,9 @@ public class TokenController {
//web端登录
@PostMapping("login")
public R<?> login(@RequestBody LoginBody form) throws Exception {
String decryptedData = RsaUtil.decryptByPrivateKey(form.getPassword(), privateKey);
//String decryptedData = RsaUtil.decryptByPrivateKey(form.getPassword(), privateKey);
// 用户登录
LoginUser userInfo = sysLoginService.login(form.getUsername(), decryptedData);
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
String uuid = form.getUuid();
String captcha = redisService.getCacheObject(CacheConstants.CAPTCHA_CODE_KEY + uuid).toString();
if (StringUtils.isBlank(captcha)) {

View File

@ -50,4 +50,17 @@ public class InventoryAndWarehousingController extends BaseController {
return inventoryAndWarehousingService.savePutInfo(dto);
}
/**
* 根据入库单号查看详情
* @param bean
* @return
*/
@ApiOperation(value = "根据入库单号查看详情")
@GetMapping("/getDetail")
public TableDataInfo getDetail(PutInStorageBean bean) {
startPage();
List<PutInStorageBean> list = inventoryAndWarehousingService.getDetails(bean);
return getDataTable(list);
}
}

View File

@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* @description 入库盘点
@ -44,6 +43,10 @@ public class PutInStorageBean extends BaseEntity {
@ApiModelProperty(value = "盘点入库单号")
private String kindName;
/** 设备编号 */
@ApiModelProperty(value = "设备编号")
private String maCode;
/** 单位ID */
@ApiModelProperty(value = "单位ID")
private String unitId;
@ -85,6 +88,10 @@ public class PutInStorageBean extends BaseEntity {
@ApiModelProperty(value = "设备工器具类型名称")
private String typeName;
/** 规格型号 */
@ApiModelProperty(value = "规格型号")
private String typeModelName;
/** 设备主键 */
@ApiModelProperty(value = "设备主键")
private Integer machine;

View File

@ -74,4 +74,11 @@ public interface InventoryAndWarehousingMapper {
int selectTaskNumByMonth(@Param("date") Date nowDate);
int selectByCode(String code);
/**
* 根据入库单号查看详情
* @param bean
* @return
*/
List<PutInStorageBean> getDetails(PutInStorageBean bean);
}

View File

@ -27,4 +27,11 @@ public interface InventoryAndWarehousingService {
* @return
*/
AjaxResult savePutInfo(SavePutInfoDto dto);
/**
* 根据入库单号查看详情
* @param bean
* @return
*/
List<PutInStorageBean> getDetails(PutInStorageBean bean);
}

View File

@ -119,6 +119,16 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
return AjaxResult.success(res);
}
/**
* 根据入库单号查看详情
* @param bean
* @return
*/
@Override
public List<PutInStorageBean> getDetails(PutInStorageBean bean) {
return inventoryAndWarehousingMapper.getDetails(bean);
}
/**
* 根据code从ma_machine表查询是否有数据去重
* @param code

View File

@ -198,35 +198,50 @@
</update>
<select id="getList" resultType="com.bonus.sgzb.material.domain.PutInStorageBean">
SELECT pisi.PUT_IN_TYPE as putInType,
lot.lot_name as projectName,
bui.unit_name as unitName,
pisi.`CODE` as kindName,
mt2.type_name as typeName,
su.user_name as modelName,
pisi.CREATE_DATE as createDate,
pisi.REMARKS as remark
FROM ma_type_put_in_storage_info pisi
LEFT JOIN ma_type_put_in_storage_details pisd on pisi.id = pisd.INFO
LEFT JOIN bm_project_lot lot on lot.lot_id = pisi.PROJECT_ID
LEFT JOIN bm_unit_info bui on bui.unit_id = pisi.UNIT_ID
LEFT JOIN ma_type mt on mt.type_id = pisd.TYPE
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
LEFT JOIN sys_user su on su.user_id = pisi.CREATOR
where
SELECT
sub.putInType,
sub.projectName,
sub.unitName,
sub.kindName,
sub.typeName,
sub.modelName,
sub.createDate,
sub.remark
FROM (
SELECT
pisi.PUT_IN_TYPE AS putInType,
lot.lot_name AS projectName,
bui.unit_name AS unitName,
pisi.`CODE` AS kindName,
mt2.type_name AS typeName,
su.user_name AS modelName,
pisi.CREATE_DATE AS createDate,
pisi.REMARKS AS remark,
ROW_NUMBER() OVER (PARTITION BY pisi.`CODE` ORDER BY pisi.CREATE_DATE DESC) AS row_num
FROM
ma_type_put_in_storage_info pisi
LEFT JOIN ma_type_put_in_storage_details pisd ON pisi.id = pisd.INFO
LEFT JOIN bm_project_lot lot ON lot.lot_id = pisi.PROJECT_ID
LEFT JOIN bm_unit_info bui ON bui.unit_id = pisi.UNIT_ID
LEFT JOIN ma_type mt ON mt.type_id = pisd.TYPE
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
LEFT JOIN sys_user su ON su.user_id = pisi.CREATOR
WHERE
1 = 1
<if test="keyWord != null and keyWord != ''">
and (
pisi.`CODE` like concat('%',#{keyWord},'%') or
pisi.PUT_IN_TYPE like concat('%',#{keyWord},'%') or
lot.lot_name like concat('%',#{keyWord},'%') or
bui.unit_name like concat('%',#{keyWord},'%') or
mt2.type_name like concat('%',#{keyWord},'%') or
su.user_name like concat('%',#{keyWord},'%') or
pisi.REMARKS like concat('%',#{keyWord},'%')
)
AND (
pisi.`CODE` LIKE CONCAT('%',#{keyWord},'%') OR
pisi.PUT_IN_TYPE LIKE CONCAT('%',#{keyWord},'%') OR
lot.lot_name LIKE CONCAT('%',#{keyWord},'%') OR
bui.unit_name LIKE CONCAT('%',#{keyWord},'%') OR
mt2.type_name LIKE CONCAT('%',#{keyWord},'%') OR
su.user_name LIKE CONCAT('%',#{keyWord},'%') OR
pisi.REMARKS LIKE CONCAT('%',#{keyWord},'%')
)
</if>
order by pisi.CREATE_DATE desc
) AS sub
WHERE sub.row_num = 1
ORDER BY createDate DESC
</select>
<select id="selectTaskNumByMonth" resultType="java.lang.Integer">
select count(*) from ma_type_put_in_storage_info where DATE_FORMAT(CREATE_DATE,'%y%m') = DATE_FORMAT(#{date},'%y%m')
@ -238,4 +253,37 @@
<if test="code != null ">and qr_code = #{code}</if>
</where>
</select>
<select id="getDetails" resultType="com.bonus.sgzb.material.domain.PutInStorageBean">
SELECT
pisi.`CODE` as kindName,
pisi.PUT_IN_TYPE as putInType,
pisd.MACODE as maCode,
pisd.NUM as num,
mt2.type_name as typeName,
mt.type_name as typeModelName,
su.user_name as modelName,
pisi.CREATE_DATE as createDate
FROM ma_type_put_in_storage_info pisi
LEFT JOIN ma_type_put_in_storage_details pisd on pisi.id = pisd.INFO
LEFT JOIN bm_project_lot lot on lot.lot_id = pisi.PROJECT_ID
LEFT JOIN bm_unit_info bui on bui.unit_id = pisi.UNIT_ID
LEFT JOIN ma_type mt on mt.type_id = pisd.TYPE
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
LEFT JOIN sys_user su on su.user_id = pisi.CREATOR
where
1 = 1
<if test="kindName != null and kindName != ''">
and pisi.`CODE` = #{kindName}
</if>
<if test="keyWord != null and keyWord != ''">
and (
pisi.PUT_IN_TYPE like concat('%',#{keyWord},'%') or
mt2.type_name like concat('%',#{keyWord},'%') or
su.user_name like concat('%',#{keyWord},'%') or
mt.type_name like concat('%',#{keyWord},'%') or
pisd.MACODE like concat('%',#{keyWord},'%')
)
</if>
order by pisi.CREATE_DATE desc
</select>
</mapper>